DA22. 牛客网用户最高的正确率
描述
Python 3 解法, 执行用时: 785ms, 内存消耗: 524288KB, 提交时间: 2022-07-26
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print((Nowcoder[Nowcoder['Num_of_exercise']>10]['Num_of_exercise']/Nowcoder[Nowcoder['Num_of_exercise']>10]['Number_of_submissions']).max().round(3))
Python 3 解法, 执行用时: 786ms, 内存消耗: 524288KB, 提交时间: 2022-07-21
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') # 刷题数量大于10题,最高的正确率能有多少 a = Nowcoder['Num_of_exercise'][Nowcoder['Num_of_exercise'] > 10] b = Nowcoder['Number_of_submissions'][Nowcoder['Num_of_exercise'] > 10] print(round((a/b).max(), 3))
Python 3 解法, 执行用时: 793ms, 内存消耗: 524288KB, 提交时间: 2022-08-06
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') a = Nowcoder[Nowcoder['Num_of_exercise']>10]['Num_of_exercise'] b = Nowcoder[Nowcoder['Num_of_exercise']>10]['Number_of_submissions'] print('%.3f'%(a/b).max())
Python 3 解法, 执行用时: 795ms, 内存消耗: 524288KB, 提交时间: 2022-07-24
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') Nowcoder=Nowcoder.loc[Nowcoder['Number_of_submissions']>10] Nowcoder['right_cnt']=round(Nowcoder['Num_of_exercise']/Nowcoder['Number_of_submissions'],3) print(Nowcoder['right_cnt'].max())
Python 3 解法, 执行用时: 796ms, 内存消耗: 524288KB, 提交时间: 2022-07-26
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') Nowcoder=Nowcoder[Nowcoder['Num_of_exercise']>10] Nowcoder['acc']=Nowcoder['Num_of_exercise']/Nowcoder['Number_of_submissions'] print(round(Nowcoder['acc'].max(),3))