Excel筛选
选中-数字筛选
用pandas筛选数据
筛选函数
def age_18_to_30(a):
return 18<=a<30
def level_a(s):
return 85<=s<=100
.loc 用于定位,会生成新的DataFrame
因为.loc是attribute所以后面跟的是[]
books['Date'].at[i]
students=students.loc[students['Age'].apply(age_18_to_30)]
students['Age']是一个Series,有apply属性,对一列中的每个元素执行函数age_18_to_30
加入第二个筛选条件