I want to make a line chart by this code :
df = pd.DataFrame.from_dict({ 'sentencess' : sentencess, 'publishedAts' : publishedAts, 'hasil_sentimens' : hasil_sentimens })
df.to_csv('chart.csv')
df['publishedAts'] = pd.to_datetime(df['publishedAts'], errors='coerce')
by_day_sentiment = df.groupby([pd.Grouper(key='publishedAts',freq='D'),'hasil_sentimens']).size().unstack('hasil_sentimens')
sentiment_dict = by_day_sentiment.to_dict('dict')
and the output from sentiment_dict is
{'Negatif ': {Timestamp('2019-08-26 00:00:00', freq='D'): 2.0, Timestamp('2019-08-27 00:00:00', freq='D'): 4.0, Timestamp('2019-08-28 00:00:00', freq='D'): 2.0, Timestamp('2019-08-29 00:00:00', freq='D'): 3.0}, 'Netral ': {Timestamp('2019-08-26 00:00:00', freq='D'): 1.0, Timestamp('2019-08-27 00:00:00', freq='D'): 3.0, Timestamp('2019-08-28 00:00:00', freq='D'): 1.0, Timestamp('2019-08-29 00:00:00', freq='D'): 3.0}, 'Positif ': {Timestamp('2019-08-26 00:00:00', freq='D'): nan, Timestamp('2019-08-27 00:00:00', freq='D'): nan, Timestamp('2019-08-28 00:00:00', freq='D'): nan, Timestamp('2019-08-29 00:00:00', freq='D'): 1.0}}
From that sentiment_dict, how to make a new dict but the key (which is now datetime) is changed to a string?