位置: IT常识 - 正文

python中filter()的多种筛选(python filter dict)

编辑:rootadmin

推荐整理分享python中filter()的多种筛选(python filter dict),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:filter python用法,python3 filter函数,python filter dict,python filter dict,python中filter的用法,python中filter的用法,python中filter函数怎么用,python里filter,内容如对您有帮助,希望把文章链接给更多的朋友!

python中filter()的多种筛选(python filter dict)

1、筛选指定的列,类似于花式索引

df2.filter(items=['one','three'])"""onethreemouse13rabbit46"""

2、筛选以字母e结尾的列

df2.filter(regex='e$',axis=1)"""onethreemouse13rabbit46"""

3、筛选以字母e结尾的行

df2.filter(regex='e$',axis=0)"""onetwothreemouse123"""

4、筛选行索引中有bbi的行

df2.filter(like='bbi',axis=0)"""onetwothreerabbit456"""

以上就是python中filter()的多种筛选,希望对大家有所帮助。更多Python学习指路:Python基础教程

本文链接地址:https://www.jiuchutong.com/zhishi/312929.html 转载请保留说明!

上一篇:python多线程处理大量文件数据(python多线程处理excel)

下一篇:python在协程中增加任务(python的协程)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络