2021
02-27
02-27
用python 绘制茎叶图和复合饼图
茎叶图fromitertoolsimportgroupbynums2=[225,232,232,245,235,245,270,225,240,240,217,195,225,185,200,220,200,210,271,240,220,230,215,252,225,220,206,185,227,236]fork,gingroupby(sorted(nums2),key=lambdax:int(x)//10):print(k,list(g))#print('k',k)#print('g',list(g))lst=map(str,[int(y)%10foryinlist(g)])print(k,'|',''.join(lst))输出:18|5519|520|0062...
继续阅读 >