Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

drop rows of specific time

    Date              Open        High         Low        Close  Volume 
2022-08-08 09:15:00 17397.39    17443.70    17359.75    17411.06    0   
2022-08-10 13:15:00 17508.28    17532.00    17479.55    17510.24    0   
2022-08-12 09:15:00 17651.81    17680.70    17597.85    17654.14    0   
2022-08-18 09:15:00 17934.37    17954.65    17863.45    17914.30    0   

I have this dataframe . I have to drop the rows when time= 9:15

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Use ~ operator to negate the conditions:

df.Date = pd.to_datetime(df.Date)
df[~((df.Date.dt.hour == 9) & (df.Date.dt.minute == 15))]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading