[英]Plotting multiple lines in one graph with time in months on the x-axis, number of occurences on the y-axis
[英]plotting multiple date-time columns on y-axis and their corresponding ids on x-axis
我有一個帶有文檔 ID 及其相應日期時間列的 csv/excel 文件。 嘗試了以下方法:
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import datetime
import pandas as pd
xls_data = pd.read_excel(<file-path>)
x1 = xls_data["client_doc_id"].values #id column in the file
y1 = xls_data["planned_finish_ifd"].values #one of the date-time column in the file
plt.plot(x1,y1)
plt.gcf().autofmt_xdate()
plt.show()
但我無法獲得所需的輸出,而是顯示以下錯誤:
AttributeError: 'numpy.datetime64' object has no attribute 'toordinal'
如何繪制一個日期時間列以及如何在一張圖中繪制多個日期時間列?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.