I have this dataframe.
dd = pd.DataFrame({'t': np.array(['a','b', 'c', 'd', 'e', 'f', 'g']),
'o': np.array([1,2,3,4,5,6,7])})
I can't understand why this works:
print(dd.loc[2:4, 'o'].values)
[3, 4, 5]
and this doesn't :
print(dd.loc[2:-2, 'o'].values)
[]
while this does:
print(dd[['o']][2:-2].values)
[[3]
[4]
[5]]