Skip to content
Advertisement

Adding date to pd.to_datetime

I’m looking for a way to add custom date to pd.to_datetime. So, for example:

JavaScript

Print:

JavaScript

pd.to_datetime keeps adding today’s date which is fine in case of csv_file but csv_file2 need to contain tomorrow’s date.

Here’s sample of csv files:

JavaScript

Advertisement

Answer

Idea is create helper column file for distingush if tomorrow and last add 1 day by condition for compare new column:

JavaScript

Or:

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