按条件从dataframe中筛选符合条件的行
时间:2020-05-16 16:53:08
收藏:0
阅读:3370
例子1:精确指定条件
df_mots[(df_mots[‘time‘] < 25320)&(df_mots[‘time‘] >= 25270)]
例子2:模糊条件,包含指定字符串(包含变量)
.str.contains方法
df_new = df_mots[(df_mots["HOUR_ID"] == hour_list[b]) & (df_mots[‘BSC_TS‘].str.contains(Moid))]
原文:https://www.cnblogs.com/huangyz-xy/p/12900884.html
评论(0)