I am working on loading a dataframe and have generated a variable called body.
in Python, when I print(body) it looks like this -
Data1a
Dataab
Data1c
Data2a
Data2b
Data2c
...
Datana
Datanb
Datanc
I'd like to load this variable/list into a dataframe where each group of three populates the three columns of the frame like -
Headera Headerb Headerc
Data1a Data1b Data1c
Data2a Data2b Data2c
...
Datana Datanb Datanc
I'm pretty new to python and can't find (or know how to search correctly) an example of this kind of operation. Any guidance is appreciated!!!
Or in other words - is there a way to format a variable as shown into a list for dataframe loading?
from
Data1a
Dataab
Data1c
Data2a
Data2b
Data2c
to
[['Data1a', 'Data1b', Data1c'],['Data2a', 'Data2b', 'Data2c']]
in Python, when I print(body) it looks like this -
Data1a
Dataab
Data1c
Data2a
Data2b
Data2c
...
Datana
Datanb
Datanc
I'd like to load this variable/list into a dataframe where each group of three populates the three columns of the frame like -
Headera Headerb Headerc
Data1a Data1b Data1c
Data2a Data2b Data2c
...
Datana Datanb Datanc
I'm pretty new to python and can't find (or know how to search correctly) an example of this kind of operation. Any guidance is appreciated!!!
Or in other words - is there a way to format a variable as shown into a list for dataframe loading?
from
Data1a
Dataab
Data1c
Data2a
Data2b
Data2c
to
[['Data1a', 'Data1b', Data1c'],['Data2a', 'Data2b', 'Data2c']]