https://study.163.com/course/courseMain.htm?courseId=1006383008&share=2&shareId=400000000398149(博主录制)

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.filter.html(官网介绍)

DataFrame.filter(selfitems=Nonelike=Noneregex=Noneaxis=None)[source]

Subset rows or columns of dataframe according to labels in the specified index.

Note that this routine does not filter a dataframe on its contents. The filter is applied to the labels of the index.

Parameters:
items  : list-like

Keep labels from axis which are in items.

like  : string

Keep labels from axis for which “like in label == True”.

regex  : string (regular expression)

Keep labels from axis for which re.search(regex, label) == True.

axis  : int or string axis name

The axis to filter on. By default this is the info axis, ‘index’ for Series, ‘columns’ for DataFrame.

python脚本
# -*- coding: utf-8 -*-
"""
Created on Sun Sep  8 11:32:40 2019@author: QQ231469242
"""
import pandas as pd
import numpy as npdf = pd.DataFrame(np.array(([1, 2, 3], [4, 5, 6])),index=['mouse', 'rabbit'],columns=['one', 'two', 'three'])df.filter(items=['one', 'three'])#select columns by regular expression
df.filter(regex='e$', axis=1)# select rows containing 'bbi'
df.filter(like='bbi', axis=0)

  

https://study.163.com/provider/400000000398149/index.htm?share=2&shareId=400000000398149(博主视频教学主页)

转载于:https://www.cnblogs.com/webRobot/p/11485798.html

pandas filter数据筛选相关推荐

  1. Python Pandas 列数据筛选方法汇总

    Pandas 列数据筛选方法汇总 数据准备: 一.筛选得到指定的列 1.1 根据 label 选择特定的几列 1.2 选择单列的两种方式 1.3 通过正则表达式选择列 二.同时对 行 和 列 进行筛选 ...

  2. Python Pandas 行数据筛选方法汇总

    Pandas 行数据筛选 一.准备数据 二.通过逻辑规则筛选(大于/小于等) 三.删除重复元素 三.显示最前面 / 最后面的 n 行 3.1 显示前面 n 行 3.2 显示后面 n 行 四.随机抽取 ...

  3. pandas:数据筛选的8个操作

    文章来源于 公众号 Python数据科学的文章pandas 筛选数据的 8 个骚操作,是个很不错的系列,感兴趣的同学可以移步去学习. 数据分析最常用到的就是查询筛选,按各种条件.各种维度以及组合挑出我 ...

  4. Python中pandas.Dataframe数据筛选

    Dataframe可以实现强大的数据筛选功能,下面简单举几个例子: # 创建一个DataFrame import pandas as pd import numpy as np df = pd.Dat ...

  5. pandas DataFrame数据筛选和切片

    DataFrame数据筛选--loc,iloc,ix,at,iat 条件筛选 单条件筛选 选取col1列的取值大于n的记录: data[data['col1']>n] 筛选col1列的取值大于n ...

  6. DataFrame 数据筛选

    pandas DataFrame 数据筛选 DataFrame 数据筛选 数据筛选基本格式 contains isin 多个条件与或 数据筛选进阶 groupby agg np.where DataF ...

  7. 【pandas】--DataFrame数据筛选(二)

    相关篇: DataFrame数据处理(一) dataframe高级用法三 一.数据选取 按索引标签 选取(loc做法) 按索引位置 选取(iloc做法) 1.1选取第1行的数据(选取单行数据) .lo ...

  8. pandas数据预处理(字段筛选、query函数进行数据筛选、缺失值删除)、seaborn可视化分面图(facet)、seaborn使用Catplot可视化分面箱图(Faceted Boxplot)

    pandas数据预处理(字段筛选.query函数进行数据筛选.缺失值删除).seaborn可视化分面图(facet).seaborn使用Catplot可视化分面箱图(Faceted Boxplot) ...

  9. pandas根据数据类型筛选数据

    pandas根据数据类型筛选数据 pandas根据数据类型筛选对应的特征列,因为不同的数据类型列往往对应不同的后续特征处理方法. select_dtypes是我们使用的主要函数,其中包含两个核心参数, ...

最新文章

  1. java 对象被回收的例子_Java对象的后事处理——垃圾回收(二)
  2. 支付宝何以支撑双十一4200万次/秒的数据库请求峰值?
  3. ES6中的promise、async、await用法详解
  4. AndoridSQLite数据库开发基础教程(6)
  5. python常用内建函数
  6. RDIFramework.NET V2.9版本多语言的实现
  7. 「C++」C++ Primer Plus 笔记:第二章 开始学习C++
  8. json返回页面读取data里的值都是object_【一】尤大神都说Vite香,让我来手把手分析Vite原理...
  9. 菜鸟linux的sed,Linux sed命令菜鸟入门
  10. GIT上传下载报错:[You do not have permission to pull from the repository]的解决方案!
  11. python删除链表中重复的节点_删除链表中所有值与Python相同的节点的程序
  12. python爬虫07--代理
  13. 循环计数_倒计数器:CountDownLatch | 循环栅栏:CyclicBarrier
  14. 【react】 redux 公共状态管理---数据的渲染,数据的修改,再把修改的数据渲染到当前组件...
  15. Python3 Tkinter 之 (1) 主窗口框架
  16. 大数据、物联网技术、物联网卡,对我们生活带来的影响
  17. 荐书 | 9本心理治疗书籍推荐
  18. 学习之苦也正是学习之甜------知识的本质
  19. 2021年安全生产模拟考试(全国特种作业操作证焊工作业-熔化焊接与热切割模拟考试题库一)
  20. 未来趋势:区块链溯源技术

热门文章

  1. 互联网时代,“羊毛出在狗身上,由猪买单”,打败你的不再是你的对手,而是........
  2. Ceph监控部署之inkscopeCalamari(v10.2.11)
  3. 中小型互联网公司技术研发部门组织架构及职责
  4. echarts饼图默认中间显示总数
  5. Ubuntu+Tesla M40上OpenCL问题解决过程
  6. java如何读取ic卡_java读取IC卡设备
  7. mysql 部分汉字乱码_一次mysql部分汉字乱码解决过程
  8. 大疆FPGA/芯片开发工程师(A卷)笔试题(含详解)
  9. EAS7.5服务器文件夹备份,ORACLE+EAS数据备份与恢复参考
  10. codeblocks不支持16位,与64位不兼容这个问题