1

Check this image of dataframe

[1]: https://i.stack.imgur.com/L37JZ.png

I've posted the picture of dataframe I am working with, I want to pull out data from specific times of a certain date

I've tried

  1. stockdf.loc[("2015-01-01")].loc['09:17:00']
  2. stockdf.loc[("2015-01-01","09:17:00"),:]

Both do not work.

1 Answers1

1

Just try:

stockdf.loc[("2015-01-01", "09:17:00")]

If they're dates:

stockdf.loc[(pd.to_datetime("2015-01-01").date(), pd.to_datetime("09:17:00").time())]
U13-Forward
  • 69,221
  • 14
  • 89
  • 114