Lv.1
挖坟的是我好大儿
签名:退站,别问我是谁 留着帖子主要是为了好玩 还有,编程猫给我解释一下我代码岛为什么登不上去
在 【Python作品分享】星座饼状图统计 中回复
from pyecharts import Pie import webbrowser import os import json with open("birthdaylist.json","r")as f: d=json.load(f) constellation = { "水瓶座":0, "双鱼座":0, "白羊座":0, "金牛座":0, "双子座":0, "巨蟹座":0, "狮子座":0, "喵座":0, "天秤座":0, "天蝎座":0, "天蝎座":0, "摩羯座":0, } for b in d: if1.20<=b<=2.18: constellation["水瓶座"] += 1 elif2.19<= b <=3.20: constellation["双鱼座"] += 1 elif3.21<= b <=4.19: constellation["白羊座"] += 1 elif4.20<= b <= 5.20: constellation["金牛座"] += 1 elif5.21<= b <= 6.21: constellation["双子座"] += 1 elif6.22<= b <= 7.22: constellation["巨蟹座"] += 1 elif7.23<= b <= 8.22: constellation["狮子座"] += 1 elif8.23<= b <= 9.22: constellation["喵座"] += 1 elif9.23<= b <= 10.23: constellation["天秤座"] += 1 elif10.24<= b <= 11.22: constellation["天蝎座"] += 1 elif11.23<= b <= 12.21: constellation["天蝎座"] += 1 else: constellation["摩羯座"] += 1 print(constellation) key = list(constellation.keys()) value=list(constellation.values()) pie=Pie("班级星座统计") pie.add( "", key, value, legend_pos="left", legend_orient="vertical", is_label_show=True,
) pie.render() webbrowser.open("file://"+os.path.realpath("render.html"))
2020-08-30T09:05:40 点赞:0
在 你们喜欢哪个兽设 中回复
第一个的网址:https://pan.baidu.com/s/1RKDjgmtoDgLx40p2EqFeww 提取码:mkxv
2020-08-30T10:52:20 点赞:0