Question

How to create a dataframe from a list in Python?


Annonce
Ad

Answer

Simply us the dataframe constructor:
>>> myList=[ [1,2,3] , [4,5,6] ]
>>> df = pd.DataFrame(myList)
>>> df
   0  1  2
0  1  2  3
1  4  5  6


[source]
# ID Query