Hi,
I want to create a time graph but the problem is that I have a csv with the same dates, but I don’t know how to graph it. I’ll keep the csv short:
Date,Quantity
2019-23-05,1
2019-23-05,4
2019-23-05,2
2019-23-05,4
2019-23-05,4
2019-23-05,4
2019-23-05,4
2019-24-05,7
2019-24-05,1
2019-23-07,1
2020-11-01,3
And my code(Updated):
import plotly.graph_objects as go
import pandas as pd
df = pd.read_csv("Publications1.csv")
dfg = df.groupby(['Date']).sum()
fig = go.Figure()
fig.add_trace(go.Scatter(
x=dfg.index,
y=dfg['Quantity'],
name="Example graph",
line_color='deepskyblue',
opacity=0.8))
fig.update_layout(xaxis_range=['2019-03-01','2020-01-31'],
title_text="Data recolected")
fig.show()
I want the amount to be shown on the graph with the sum of each month’s values. For example, 2019-23-05 has 23 quantities and this should be reflected in the graph as one point.
Thank you very much.