Here is my code
data = result["Document"]
df = pd.DataFrame(data)
df["Created"] = pd.to_datetime(df["Created"])
df["Created"] = pd.to_datetime(df["Created"],errors='coerce').dt.tz_localize('Europe/London').dt.tz_convert('Europe/Paris')
#print(df)hour
df['Created'] = df['Created'].dt.date
df["Barcode"] = df["Barcode"].astype(str)
fig, ax = plt.subplots()
myFmt = mdates.DateFormatter('%Y-%m-%d %H:%M')
ax.xaxis.set_major_formatter(myFmt)
df1 = df.groupby(["Created"])["Tag"].count().reset_index()
df2 = df[df["Tag"] == "DISPLAY"].groupby(["Created"])["Tag"].count().reset_index()
plt.plot(df2['Created'],df2['Tag'])
plt.plot(df1['Created'],df1['Tag'])
plt.gcf().autofmt_xdate()
plt.figure(figsize=(30,20))
plt.show()
The problem is that i have an hpur that don't exist :
2019-03-31 01:50:24.455000
With the changing hour this timedate does not exist in france.
So that's why it crash.
How to convert the date taking that in count ?
Regards