Код: Выделить всё
x
Код: Выделить всё
x
year mar 31, 2024 mar 31, 2023
0 net income 306.000 524.0000
1 net income growth -0.416 -0.0455
2 retained rate NaN NaN
3 pe 419.930 0.0000
Код: Выделить всё
x.index
RangeIndex(start=0, stop=4, step=1)
x.columns
Index(['year', 'mar 31, 2024', 'mar 31, 2023'], dtype='object')
new_x
Код: Выделить всё
year net income net income growth retained rate pe
0 mar 31, 2024 306.0 -0.416 NaN 419.93
1 mar 31, 2023 524.0 -0.0455 NaN 0.0
new_x.index
RangeIndex(start=0, stop=1, step=1)
new_x.columns
['year', 'net income', 'net income growth', 'retained rate', 'pe']
Код: Выделить всё
x.T
0 1 2 3
year net income net income growth retained rate pe
mar 31, 2024 306.0 -0.416 NaN 419.93
mar 31, 2023 524.0 -0.0455 NaN 0.0
Подробнее здесь: https://stackoverflow.com/questions/787 ... ffectively