Pandas filter dataframe rows with a specific year

I have a dataframe df and it has a Date column. I want to create two new data frames. One which contains all of the rows from df where the year equals some_year and another data frame which contains all of the rows of df where the year does not equal some_year. I know you can do df.ix['2000-1-1' : '2001-1-1'] but in order to get all of the rows which are not in 2000 requires creating 2 extra data frames and then concatenating/joining them.

Pandas: Datetime Improperly selecting day as month from date

I’m working with some datetime data in a dataframe. It’s in a format day/month/year Ex: Date —————- 27/06/2021 00:00 27/06/2021 00:00 30/06/2021 00:00 30/06/2021 00:00 30/06/2021 00:00 18/06/2021 00:00 26/06/2021 00:00 28/06/2021 00:00 28/06/2021 00:00 27/06/2021 00:00 28/06/2021 00:00 30/06/2021 00:00 12/06/2021 00:00 28/06/2021 00:00 I want to extract the month and year, so I … Read more

Which is the fastest way to extract day, month and year from a given date?

I read a csv file containing 150,000 lines into a pandas dataframe. This dataframe has a field, Date, with the dates in yyyy-mm-dd format. I want to extract the month, day and year from it and copy into the dataframes’ columns, Month, Day and Year respectively. For a few hundred records the below two methods work ok, but for 150,000 records both take a ridiculously long time to execute. Is there a faster way to do this for 100,000+ records?