type
status
date
slug
summary
tags
category
icon
password
  • 文件相关
    • 文件读取
      • read_csv / read_excel / read_html / read_sql
    • 文件信息
      • head:前n 行数据
      • info:基本信息
      • describe:描述性统计
        • percentiles: 分位数,默认 [.25, .5, .75]
        • include / exclude:
      • dtypes:数据类型
  • 查询、过滤、排序
    • 查询
      • loc:基于标签若使用[[]]会返回DataFrame
      • iloc:基于索引
    • 统计函数
      • value_counts:统计非空元素出现个数
      • count: 统计该列非空元素个数(过滤空值,但包含空字符串)
      • unique:统计所有唯一元素个数(包含空值及空字符串)
      • nunique:统计所有唯一元素个数(不包含空值,但包含空字符串)
  • 文本方法
    • 字符串方法
      • str.startwith
      • str.endwith
      • str.contains
  • 高阶方法
    • 聚合函数
      • groupby:分组函数
        • notion image
      • agg:合并操作
    • 索引重排
      • 列值变列索引
        • pivot:长数据 -> 宽数据
          • notion image
        • pivot_table:若两行数据完全相同则pivot会报错,采用本函数替代;另外能用 aggfunc 聚合数据
      • 列索引变列值
        • melt:pivot的逆操作,宽数据 -> 长数据
      • 行列索引移动
        • stack:将原来的列索引变为最内层的行索引
          • notion image
        • unstack:把最内层的行索引还原为列索引
          • notion image
      • 哑变量与因子化
        • get_dummies:one-hot 编码
        • factorize:自然数编码
      • 其他索引相关函数
        • reset_index:重置索引,可移除多重索引
    • 函数方法
      • map:作用于Series
      • apply:作用于DataFrame的行 / 列
      • applymap:作用于DataFrame
  • 多表拼接
    • concat:默认axis=0
    • merge:默认axis=1
    •  
思维导图
notion image
Notion + NotionNext 打造个人博客Python 抓取豆瓣影音信息导入 Notion
  • Twikoo