gagaein

使用bool表达式和query方法都很难写。。

最容易写的是基于map的筛选

例如:
user_requried = all_data[\'User_id\'].map(lambda x : x==1439408)
date_requried = all_data[\'Date\'].map(lambda x : np.isnan(x))
some = all_data[user_requried & date_requried]


其中map返回的值必须是bool类型,即某一个条件。然后使用直接筛选的方式,把条件合并,最终得出筛选的结果。我认为使用此种类型的方法更加的优美。

分类:

技术点:

相关文章:

猜你喜欢
相关资源
相似解决方案