pivot table raise error uniquely valued index error

You can use np.reshape:

print (pd.DataFrame(df.to_numpy().reshape((-1, 2)), columns=["Rank", "Maj"]))

   Rank     Maj
0     2   31.92
1     3       0
2     4   33.72
3     5   24.89
4     6  0.00.1
5     7  148.35
6     8   28.26
7     9       0
8    10    5.96
9    11    7.66

...

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top