Manipulating Dates by Adding Time Intervals

Learn how to add to and subtract from a date with Python Pandas.

The DateOffset function

One Pandas function we can use to add or subtract dates and times is DateOffset. It can be used with both dates and times. We only need to specify the unit and quantity to be added or subtracted. Consider a case where we want to give a raise to our employees one year after they’re hired. In the staff, we can create a column called raise_date by adding one year to the start_date column.

Get hands-on with 1200+ tech skills courses.