[英]How to plot a csv file with pandas?
I have csv file
Mappe3.csv
with two columns. 我有两列的csv文件
Mappe3.csv
。 It looks like 看起来像
Quartals;Counts
0 2004Q1 ;258526
1 2004Q2 ;205120
2 2004Q3 ;134822
3 2004Q4 ;154606
4 2005Q1 ;244813
5 2005Q2 ;156623
6 2005Q3 ;125472
7 2005Q4 ;11093
8 2006Q1 ;536
9 2006Q2 ;142400
10 2006Q3 ;270221
11 2006Q4 ;313063
12 2007Q1 ;386541
13 2007Q2 ;417533
14 2007Q3 ;423587
15 2007Q4 ;424799
16 2008Q1 ;503836
17 2008Q2 ;485872
18 2008Q3 ;686549
19 2008Q4 ;777268
Now I tried to plot the data with "quartals" on the x-axis and "counts" on the y-axis (with code below). 现在,我尝试在x轴上使用“ quartals”,在y轴上使用“ counts”绘制数据(以下代码)。 It seems to be quiet simple but nothing works...
似乎很安静,但没有任何效果...
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('Mappe3.csv')
df.plot(x="Quartals", y="Counts")
plt.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.