Deleting rows between multiple sets of time stamps

Deleting rows between multiple sets of time stamps

I have a DataFrame that has time stamps in the form of (yyyy-mm-dd hh:mm:ss). I'm trying to delete data between two different time stamps. At the moment I can delete the data between 1 range of time stamps but I have trouble extending this to multiple time stamps.

I have a DataFrame that has time stamps in the form of (yyyy-mm-dd hh:mm:ss). I'm trying to delete data between two different time stamps. At the moment I can delete the data between 1 range of time stamps but I have trouble extending this to multiple time stamps.

For example, with the DataFrame I can delete a range of rows (e.g. 2015-03-01 00:20:00 to 2015-08-01 01:10:00) however, I'm not sure how to go about deleting another range alongside it. The code that does that is shown below.

index_list= df.timestamp[(df.timestamp >= "2015-07-01 00:00:00") & (df.timestamp <= "2015-12-30 23:50:00")].index.tolist()

df1.drop(df1.index[index_list1, inplace = True)

The DataFrame extends over 3 years and has every day in the 3 years included. I'm trying to delete all the rows from months July to December (2015-07-01 00:00:00 to 2015-12-30 23:50:00) for all 3 years.

I was thinking that I create a helper column that gets the Month from the Date column and then drops based off the Month from the helper column.

I would greatly appreciate any advice. Thanks!

Edit: I've added in a small summarised version of the DataFrame. This is what the intial DataFrame looks like.

df    Date                   v
    2015-01-01 00:00:00     30.0
    2015-02-01 00:10:00     55.0
    2015-03-01 00:20:00     36.0
    2015-04-01 00:30:00     65.0
    2015-05-01 00:40:00     35.0
    2015-06-01 00:50:00     22.0
    2015-07-01 01:00:00     74.0
    2015-08-01 01:10:00     54.0
    2015-09-01 01:20:00     86.0
    2015-10-01 01:30:00     91.0
    2015-11-01 01:40:00     65.0
    2015-12-01 01:50:00     35.0

To get something like this

df    Date                   v
    2015-01-01 00:00:00     30.0
    2015-02-01 00:10:00     55.0
    2015-03-01 00:20:00     36.0
    2015-05-01 00:40:00     35.0
    2015-06-01 00:50:00     22.0
    2015-11-01 01:40:00     65.0
    2015-12-01 01:50:00     35.0

Where time stamps "2015-07-01 00:20:00 to 2015-10-01 00:30:00"and "2015-07-01 01:00:00 to 2015-10-01 01:30:00" are removed. Sorry if my formatting isn't up to standard.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Python Pandas Tutorial - Data Analysis with Python Pandas

Python Pandas Tutorial - Data Analysis with Python Pandas will help you get started with Python Pandas Library for various applications including Data analysis. You'll learn: Introduction to Pandas; DataFrames and Series; How To View Data? Selecting Data; Handling Missing Data; Pandas Operations; Merge, Group, Reshape Data; Time Series And Categoricals; Plotting Using Pandas

Python Pandas Tutorial - Data Analysis with Python Pandas

Python Pandas Tutorial will help you get started with Python Pandas Library for various applications including Data analysis. Introduction to Pandas. DataFrames and Series. How To View Data? Selecting Data. Handling Missing Data. Pandas Operations. Merge, Group, Reshape Data. Time Series And Categoricals. Plotting Using Pandas

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...