DA18. 用分位数分析牛客网用户活动
描述
Python 3 解法, 执行用时: 778ms, 内存消耗: 524288KB, 提交时间: 2022-07-21
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') a = Nowcoder[['Achievement_value','Continuous_check_in_days']].quantile(0.25) b = Nowcoder[['Num_of_exercise','Number_of_submissions']].quantile(0.75) print(a) print(b)
Python 3 解法, 执行用时: 796ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') a=Nowcoder[['Achievement_value','Continuous_check_in_days']].quantile(0.25) b=Nowcoder[['Num_of_exercise','Number_of_submissions']].quantile(0.75) print(a,b)
Python 3 解法, 执行用时: 797ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print(Nowcoder[["Achievement_value","Continuous_check_in_days"]].quantile(0.25)) print(Nowcoder[["Num_of_exercise","Number_of_submissions"]].quantile(0.75))
Python 3 解法, 执行用时: 800ms, 内存消耗: 524288KB, 提交时间: 2022-08-02
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') df = Nowcoder a = df[['Achievement_value','Continuous_check_in_days']].quantile(0.25) b = df[['Num_of_exercise','Number_of_submissions']].quantile(0.75) print(a,'\n',b)
Python 3 解法, 执行用时: 803ms, 内存消耗: 524288KB, 提交时间: 2022-08-02
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print(Nowcoder.loc[:,["Achievement_value", "Continuous_check_in_days"]].quantile(q=0.25)) print(Nowcoder.loc[:,["Num_of_exercise", "Number_of_submissions"]].quantile(q=0.75))