In order to join two dataframes df_A and df_B where a date of df_A should lie between a date range of dataframe df_B I am using pandasql. However i noticed that pandasql does not return a proper date (datetime64) as in the original dataframe but a string (object). Is there an easy way to solve this or do i have to apply a string to date conversion everytime I have executed a query?
import pandasql as ps
sql = """select invoice_date from df_A"""
ps.sqldf(sql, locals())
I would expect this output to be the same as just df_A.loc[:,'invoice_date']
Instead as an example this gives me
'2018-01-02 00:00:00.000000'
(as a string) rather than '2018-01-02'
(as date)