0

By creating a df from the date of a json file, I'm getting the results with the axis inverted than I'd like to. E.g. for...

df = pd.DataFrame(data['relevant_cohort'])

I get...

---- X1 - X2
Y1 - 0,1 - 0,3
Y2 - 2.3 - 1.1

But I'd like to have Xs as rows and Ys as columns.

How could I invert columns x rows during the creation of the DF? Thx!

42piratas
  • 555
  • 1
  • 9
  • 26

0 Answers0