I have a small dataframe like below:
Here is the code:
my_dates = [datetime(2016, 1, 1), datetime(2016, 1, 2), datetime(2016,1,3)]
dt_ind = pd.DatetimeIndex(my_dates)
data = [2,8,15]
cols = ['num']
df = pd.DataFrame(data,dt_ind,cols)
I am trying to find the date on which we have high value. So I used:
df['num'].argmax()
But instead of showing output as 2016-01-03
, I am getting 2
.
What am I doing wrong?