Guest User

Untitled

a guest
Mar 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. from fbprophet import Prophet
  2.  
  3. fc_df = df[['District']]
  4. fc_df.reset_index(inplace=True)
  5. fc_df = df.groupby(['Date', 'District']).size()
  6. fc_df = fc_df.reset_index()
  7. fc_df.columns = ['ds', 'District', 'y']
  8.  
  9. # Foi escolhido o distrito 1.0 para realizar o forecast
  10. # =====================================================
  11. aux = fc_df[fc_df['District']==1.0]
  12. aux = aux[['ds', 'y']]
  13.  
  14. ax = aux.set_index('ds').plot(figsize=(16, 8))
  15. ax.set_ylabel('Number of Crimes')
  16. ax.set_xlabel('Date')
  17.  
  18. plt.show()
Add Comment
Please, Sign In to add comment