2

How would you go about converting a list into a python data-frame.

For example:

listA = [1,20,12,4]

To be converted to

   listA
0  1
1  20
2  12
3  4

What is the simpliest way to achieve this?

Techno04335
  • 1,265
  • 5
  • 20
  • 40

1 Answers1

5
listA = [1,20,12,4]
pd.DataFrame(data = listA , columns=['listA'])
Nader Hisham
  • 4,734
  • 4
  • 17
  • 35