0

I have pandas dataframe. Using read_csv(), groupby().sum() and other.

A and I get:

                  %
Year    Month   
--------------------
2019 |  12  | -3.95%
2020 |  1   | -8.92%
        2   |  2.93%
        6   |  9.66%
        7   |  10.62%
        8   | -5.49%
        9   | -1.24%
        10  | -11.24%
        11  |  12.62%
        12  | -0.88%
2021 |  1   |  1.69%
        2   |  0.00%

And I want:

enter image description here

Left red arrow - years column

Right red arrow - months row

Center red arrow - own text

I have looked at Transpose and unstack(), but not succeed.

Any suggestions would be appreciated

Subbu VidyaSekar
  • 2,503
  • 3
  • 21
  • 39

0 Answers0