I have a panda dataframe with a column with date format as below:
PublishDate= 2018-08-31 I used panda to_gbq() function to dump data into a bigquery table. Before dumping data, I make sure that the format of columns match with table scheme. publishedate is date only in bigquery table. How can achieve something similar to:
df['PublishDate'] = df['PublishDate'].astype('?????')
I tried datetime64[D] and
df['PublishDate'] = pd.to_datetime(df['PublishDate'], format='%Y-%m-%d', errors='coerce').dt.date
df['PublishDate'] = [time.to_date() for time in df['PublishDate']]
but those didn't work!