题解 | 大佬用户成就值比例
import sys import pandas as pd df = pd.read_csv('Nowcoder.csv') total = df['Achievement_value'].sum() statis = df[df['Level'] == 7]['Achievement_value'].agg(lambda x: float(x/total)) print(pd.Series(statis, name='Achievement_value'))
import sys import pandas as pd df = pd.read_csv('Nowcoder.csv') total = df['Achievement_value'].sum() statis = df[df['Level'] == 7]['Achievement_value'].agg(lambda x: float(x/total)) print(pd.Series(statis, name='Achievement_value'))
相关推荐