Skip to content
Advertisement

subtracting time intervals from column dates in dataframes Pandas Python

How would I be able to subtract 1 second and 1 minute and 1 month from data['date'] column?

JavaScript

Advertisement

Answer

Your date column is of type string. Convert it to pd.Timestamp and you can use pd.DateOffset:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement