pandas drop 1970 1

pandas drop 1970

new_df = df[(df['Delivery Date'].dt.year != 1970)]

Here is what the above code is Doing:
1. We are creating a new dataframe called new_df.
2. We are telling Python to only include rows from the original dataframe (df) where the year is not 1970.
3. We are using the .dt accessor to select the year from the ‘Delivery Date’ column.

Similar Posts