Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
Convierta la lista en un marco de datos de pandas

Estoy tratando de convertir mi salida en un marco de datos de pandas y estoy luchando. tengo esta lista

 my_list = [1,2,3,4,5,6,7,8,9]

Quiero crear un marco de datos de pandas que tenga 3 columnas y tres filas. trato de usar

 df = pd.DataFrame(my_list, columns = list("abc"))

pero no parece estar funcionando para mí. Cualquier ayuda sería apreciada.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Necesita convertir la list en numpy array y luego reshape :

 df = pd.DataFrame(np.array(my_list).reshape(3,3), columns = list("abc")) print (df) abc 0 1 2 3 1 4 5 6 2 7 8 9
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!