Ultimate python DateParser with holidays, paydays and all the good stuff

Danil Zherebtsov
5 min readFeb 10, 2022

Datetime is one of the strongest features in any data.

If handled correctly, it can reveal a whole bunch of useful data points that highlight different peculiarities inside statistics.

Say you are analysing/predicting sales. In this regard datetime information might help you figure out that weekends sales bring the most revenue; or coffee is best sold between 8 and 9 am; or certain holidays trigger certain sales patterns; or payday impacts the sales amount; or difference in types of clothing being sold is subject to the season/quarter.

All of this can be revealed/taken advantage of if datetime feature is parsed correctly.

There are two complications:

I

Find the datetime column: when importing data, in most cases the datetime column(s) will be represented as strings. Manually looking through the columns is a way out, but sometimes you need a program automatically read through the data and find all the datetime-like columns. The number of formats your datetime can be stored in does not make it easier:

--

--