Home > Mobile >  How to split a dataframe column into multiple rows and transform string
How to split a dataframe column into multiple rows and transform string

Time:08-17

I am pulling some data from a graphql api and the data I am getting is being returned in a dict like this:

raw data return

and then I also turned the dict into a pandas dataframe which returns this:

pandas df

so from my beginner understanding, it looks like the 'swaps' row is just a super long string. I was looking at some online tutorials and still cannot figure out how to transform this row into many rows (its 1000 rows). Any help would be greatly appreciated!

CodePudding user response:

You can only convert value of swaps to dataframe

df = pd.DataFrame(x['data']['swaps'])
  • Related