I have the following Pandas DataFrame:
open high low close volume
timestamp
2005-03-06 17:00:00 1225.75 1226.25 1225.00 1225.50 1668.0
2005-03-06 17:30:00 1225.75 1227.50 1225.75 1227.00 1603.0
2005-03-06 18:00:00 1227.00 1227.50 1226.75 1227.25 590.0
2005-03-06 18:30:00 1227.25 1227.50 1226.75 1226.75 213.0
2005-03-06 19:00:00 1227.00 1227.00 1226.25 1226.25 521.0
I retrieve a row at a time of interest in the following way:
t_of_interest = dt (2005, 3, 6, 18)
price_data.loc[t_of_interest]
It correctly returns
open 1227.00
high 1227.50
low 1226.75
close 1227.25
volume 590.00
Name: 2005-03-06 18:00:00, dtype: float64
I would now like to retrieve the index of that row as an integer value. Ie in this example it should be 2
(the 3rd row). How would i go about to do that? I've forayed into using get_loc but i am a bit confused