DA19. 牛客网大佬之间的差距
描述
Python 3 解法, 执行用时: 780ms, 内存消耗: 524288KB, 提交时间: 2022-07-25
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') maxa = Nowcoder[Nowcoder['Level']== 7]['Achievement_value'].max() mina = Nowcoder[Nowcoder['Level'] == 7]['Achievement_value'].min() print(maxa-mina)
Python 3 解法, 执行用时: 790ms, 内存消耗: 524288KB, 提交时间: 2022-07-26
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') print(max(Nowcoder[Nowcoder["Level"]==7]["Achievement_value"])-min(Nowcoder[Nowcoder["Level"]==7]["Achievement_value"]))
Python 3 解法, 执行用时: 792ms, 内存消耗: 524288KB, 提交时间: 2022-07-22
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') #print(Nowcoder[Nowcoder['Level']==7].Achievement_value.max()-Nowcoder[Nowcoder['Level']==7].Achievement_value.min()) data=Nowcoder[Nowcoder['Level']==7]['Achievement_value'].values.ptp() print(int(data))
Python 3 解法, 执行用时: 794ms, 内存消耗: 524288KB, 提交时间: 2022-07-23
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') a = Nowcoder[Nowcoder.Level == 7]['Achievement_value'].max() b = Nowcoder[Nowcoder.Level == 7]['Achievement_value'].min() print(int(a-b))
Python 3 解法, 执行用时: 795ms, 内存消耗: 524288KB, 提交时间: 2022-07-28
import pandas as pd Nowcoder = pd.read_csv('Nowcoder.csv', sep=',') result = Nowcoder[Nowcoder['Level']==7].Achievement_value.max()-Nowcoder[Nowcoder['Level']==7].Achievement_value.min() print(result)