I am using pandas to get data from a sql query and json. I inspected both dataframes and the both have just the dates with no time. When I concat them it adds 00:00:00 to the date of one of the dataframes in the new dataframe. Why is it doing this. And is there a work around.
I am trying to join 2 dataframes and drop_duplicates but this prevents it from functioning properly by the date unless I specify other columns in the drop_duplicates.
Although I don't understand the underlying problem with the concat adding 00:00:00 after the date of one of the dataframes this code in the concat fixed it
pdjoin = pd.concat([pdhistory.astype({'date': 'str'}), pdtest.astype({'date': 'str'})])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With