- くだすれPython(超初心者用) その40
888 :工学部生[]:2019/01/29(火) 13:04:00.52 ID:27+2G0zN - d={}
with open("elect.txt", "r") as f: for x in f: x = x.strip() if x!="木村" and x!="くれぱす": x="無効票" try: d[x]+=1 except: d[x]=1 x = d.keys() y = d.values() import matplotlib.pyplot as plt %matplotlib inline plt.bar(x,y) plt.show() # 可視化
|