Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from fbprophet import Prophet
- fc_df = df[['District']]
- fc_df.reset_index(inplace=True)
- fc_df = df.groupby(['Date', 'District']).size()
- fc_df = fc_df.reset_index()
- fc_df.columns = ['ds', 'District', 'y']
- # Foi escolhido o distrito 1.0 para realizar o forecast
- # =====================================================
- aux = fc_df[fc_df['District']==1.0]
- aux = aux[['ds', 'y']]
- ax = aux.set_index('ds').plot(figsize=(16, 8))
- ax.set_ylabel('Number of Crimes')
- ax.set_xlabel('Date')
- plt.show()
Add Comment
Please, Sign In to add comment