DA17. 牛客网最多的用户等级
描述
Python 3 解法, 执行用时: 781ms, 内存消耗: 524288KB, 提交时间: 2022-07-25
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') res = Nowcoder['Level'].mode() print(pd.DataFrame(res,columns = ['Level']))
Python 3 解法, 执行用时: 782ms, 内存消耗: 524288KB, 提交时间: 2022-07-26
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print( Nowcoder.loc[:,['Level']].mode() )
Python 3 解法, 执行用时: 782ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') df=Nowcoder['Level'].mode() print(pd.DataFrame(df,columns=['Level']))
Python 3 解法, 执行用时: 790ms, 内存消耗: 524288KB, 提交时间: 2022-07-26
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') Mode=Nowcoder['Level'].mode() print(pd.DataFrame(Mode,columns=['Level']))
Python 3 解法, 执行用时: 797ms, 内存消耗: 524288KB, 提交时间: 2022-07-21
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') res = Nowcoder.Level.mode() print(pd.DataFrame(res,columns=["Level"]))