Вот мой код
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()
Проблема в том, что у меня есть hpur, которого не существует:
2019-03-31 01:50:24.455000
С изменением часа эта дата не существует во Франции.
Так вот почему он падает.
Как преобразовать дату с учетом этого?
Привет