[英]Plot a graph using Matplotlib
I have the date saved in csv file in this form我以这种形式将日期保存在 csv 文件中
enter image description here在此处输入图像描述
How can i draw a line or a bar graph for such data.我怎样才能为这些数据绘制一条线或条形图。 Any help will be much appreciated.
任何帮助都感激不尽。 Thanks
谢谢
try something like this:尝试这样的事情:
import pandas
import matplotlib.pyplot as plt
PATH_CSV_FILE = "Path/to/your/data.csv"
data = pandas.read_csv(PATH_CSV_FILE)
plt.plot(data["Date"], data["Price"])
plt.xlabel("Data")
plt.ylabel("Price")
plt.title("your title")
plt.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.