Select only rows that occur at specific time

Viewed 7455

I have read in C.csv and the datetime column is a object type.

I want to get every row that has 23:45:00 in it, regardless of date. I would like to have datetime as index and i would like to convert datetime index to datetime64[ns]. I believe pandas is designed for this sort of thing but I'm getting my indexes and data-types mixed up.

    import datetime as dt
    import pandas as pd
    df = pd.read_csv('C.csv', index_col = 'datetime', parse_dates=['datetime'])

The dataframe:

                     C      H      L      O  OI  V    WAP
datetime                                                     
2017-04-22 09:23:00  39.48  39.48  39.48  39.48   0  0  39.48
2017-04-22 09:24:00  39.48  39.48  39.48  39.48   0  0  39.48
2017-04-22 09:25:00  39.48  39.48  39.48  39.48   0  0  39.48
2017-04-22 09:26:00  39.44  39.44  39.44  39.44   1  4  39.44
2017-04-22 09:27:00  39.48  39.48  39.48  39.48   3  2  39.48
1 Answers
Related