Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from bokeh.io import output_file, show
- from bokeh.models import ColumnDataSource
- from bokeh.plotting import figure
- dataframe = pd.read_csv("practise.csv")
- print(dataframe.info())
- output_file('output_practise.html', title='practise')
- dataframe["Date"] = pd.to_datetime(dataframe["Date"])
- dataframe.sort_values(by=['Date'], inplace=True)
- dataframe_sum = dataframe.groupby(pd.Grouper(freq='M')).sum()
- print(dataframe)
- fig = figure(x_axis_type="datetime")
- source_sum = ColumnDataSource(dataframe_sum)
- fig.line(x="Date", y="Value",legend="sum",line_color="blue",line_width=3, source=source_sum)
- show(fig)
- # change style again
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement