Python error : TypeError: Object of type 'Timestamp' is not JSON serializable'
You can try convert datetime to string:
df['Date'] = df['Date'].astype(str)
Or:
df['Date'] = df['Date'].dt.strftime('%Y-%m-%d %H:%M:%S')
print (df.dtypes)
Id object
Name object
Date object
Type object
dtype: object
If you get an error TimeStamp has no attribute as "astype(str)"
, you can try, for example, str(timeseries.index[0])
. This will convert the timestamp into a string that can then be serialized.