我的CSV文件看起来像图片中的一个,我已经绘制了非洲第一个容易使用代码的国家的死亡率
from matplotlib import pyplot
import csv
f = open('000003.csv')
data = list(csv.reader(f))[0:3]
year = [i[1] for i in data[1::]]
africa_neonatal_mortality = [i[2] for i in data[1::]]
pyplot.plot(year, death rate,'r')
pyplot.title('death rate vs Year')
pyplot.xlabel('Years')
pyplot.ylabel('death rate')
pyplot.show()
我要做的是画出所有国家的死亡率和出生率的图表。我被困住了!在
我是python的初学者,任何帮助都将不胜感激。在
我想它可以全部在一个命令中,类似
pyplot.plot(year, death rate,'r',year,birth_rate,'bs')
。然后可以根据需要修改其他详细信息,如title和xlabel相关问题 更多 >
编程相关推荐