Reputation: 23
I am having issues inserting this dataframe into a sql table due to the 'DATE' variable. I need to get rid of the Timestamp that shows up when I change it to a tuple
Getting tuple from df to use in sql insert
What is the best way to get rid of the 'Timestamp('DATE') and have only 'DATE'? Thanks!
Upvotes: 0
Views: 87
Reputation: 3401
One of the possible ways of doing this is to convert datetime64
to String
that contains only 'DATE', in order to do this you can use datetime_as_string
function from numpy :
import numpy as np
df['DATE'] = np.datetime_as_string(df['DATE'], unit='D')
then your code will work correctly.
Upvotes: 1