I tried to use pandas along with sqlalchemy. My problem is to match time values between the pandas algorithm and sqlite restriction.
I have an Excel file with 130 columns, some columns has time values or gives pandas NaT. I won't address each column by name, so first filtering the time columns with:
u = df.select_dtypes(include=['datetime64[ns]'])
then replace the 'NaT' values with:
df[u.columns] = df[u.columns].where(df.notnull(), pd.Timestamp('1900-01-01'))
that works, so fare. Then I tried:
df[u.columns] = df[u.columns].where(df.notnull(), pd.Timestamp('1900-01-01').to_pydatetime())
but nothing is changed, the result type is Timestamp, instead of python datetime.
Tried to change that later, after generating a python dict, but can't do.
Anybody have an advice?