Let's say I've a df
value
2023-02-01 a
2023-02-02 b
2023-02-03 c
2023-02-04 d
when I try to reverse df
and after doing some operations If i reverse back It not showing complete df Like
import pandas as pd
df = pd.DataFrame(
{"value": {0: "a", 1: "b", 2: "c", 3: "d"}}
)
df.index = pd.date_range(start='2023-02-01', periods=4,freq='D')
new = df.loc[::-1] #Reversing 1 time
new2 = new.loc[::-1] # Reversing back again..
print(new2)
Giving me # even though I haven't done any operations on df
2023-02-04 d
Expected
value
2023-02-01 a
2023-02-02 b
2023-02-03 c
2023-02-04 d
Version Detials
Pandas 1.3.5
Python 3.9