DA14. Python用户的平均提交次数
描述
Python 3 解法, 执行用时: 779ms, 内存消耗: 524288KB, 提交时间: 2022-07-21
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print(round(Nowcoder[Nowcoder['Language'] == 'Python']['Number_of_submissions'].mean(),1))
Python 3 解法, 执行用时: 780ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') # data =Nowcoder[Nowcoder.Language=='Python'].Number_of_submissions.mean() data =Nowcoder[Nowcoder['Language']=='Python'].Number_of_submissions.mean() print(round(data,1))
Python 3 解法, 执行用时: 781ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') avg = Nowcoder[Nowcoder['Language'] == 'Python']['Number_of_submissions'].mean() print(round(avg, 1))
Python 3 解法, 执行用时: 789ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print(round(Nowcoder[Nowcoder['Language'] == 'Python']['Number_of_submissions'].mean(), 1))
Python 3 解法, 执行用时: 793ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print(round(Nowcoder.loc[Nowcoder['Language']== 'Python']['Number_of_submissions'].mean(),1))