位运算和字符串函数
type
status
date
slug
summary
tags
category
icon
password
Property
目录
目录

 

位运算

NumPy "bitwise_" 开头的函数是位运算函数。NumPy位运算包括以下几个函数:
函数
描述
bitwise_and
对数组元素执行位与操作
bitwise_or
对数组元素执行位或操作
invert
按位取反
矩阵库和线性代数库
type
status
date
slug
summary
tags
category
icon
password
Property

 

矩阵库

NumPy中包含了一个矩阵库 numpy.matlib,该模块中的函数返回的是一个矩阵,而不是ndarray对象。一个 的矩阵是一个由 行(row) 列(column)元素排列成的矩形阵列。矩阵里的元素可以是数字、符号或数学式。
 

matlib.empty()

matlib.empty() 返回一个新的矩阵:
Pandas
type
status
date
slug
summary
tags
category
icon
password
Property
notion image
Pandas是一个开放源码、BSD许可的库,提供高性能、易于使用的数据结构和数据分析工具,是Python 语言的一个扩展程序库
Pandas名字衍生自术语 "panel data"(面板数据)和 "Python data analysis"(Python 数据分析)。
Pandas一个强大的分析结构化数据的工具集,基础是 Numpy提供高性能的矩阵运算。
 
Pandas可以从各种文件格式比如 CSV、JSON、SQL、Microsoft Excel 导入数据。
Pandas可以对各种数据进行运算操作,比如归并、再成形、选择,还有数据清洗和数据加工特征。
Pandas广泛应用在学术、金融、统计学等各个数据分析领域。
Pandas数据结构
type
status
date
slug
summary
tags
category
icon
password
Property
目录
目录

Pandas数据结构
  • Series是一种类似于一维数组的对象,由一组数据(各种Numpy数据类型)以及一组与之相关的数据标签(即索引)组成
  • DataFrame 是一个表格型的数据结构,它含有一组有序的列,每列可以是不同的值类型(数值、字符串、布尔型值)。DataFrame既有行索引也有列索引,它可以被看做由 Series 组成的字典(共同用一个索引)
 

Series

Pandas Series 类似表格中的一个列(column),可以保存任何数据类型,由索引(index)和列组成:
参数说明:
索引操作
type
status
date
slug
summary
tags
category
icon
password
Property

 

索引对象Index

Series和DataFrame中的索引都是Index对象
 
索引对象不可变,保证了数据的安全
 
对齐运算
type
status
date
slug
summary
tags
category
icon
password
Property

 

算数运算和数据对齐

 
 
 

算术方法表

函数应用
type
status
date
slug
summary
tags
category
icon
password
Property

apply 和 applymap

层级索引
type
status
date
slug
summary
tags
category
icon
password
Property

层级索引

创建一个Series, 在输入索引Index时,输入了由两个子list组成的list,第一个子list是外层索引,第二个list是内层索引
 
MultiIndex索引对象
打印这个Series的索引类型,显示是MultiIndex,有lavels和labels两个信息:levels表示两个层级中分别有那些标签,labels是每个位置分别是什么标签
 
 
统计计算和描述
type
status
date
slug
summary
tags
category
icon
password
Property
 
 
notion image
notion image
notion image
数据加载,存储与文件格式
type
status
date
slug
summary
tags
category
icon
password
Property

 
 
 
pandas 提供了一些用于将表格型数据读取为DataFrame对象的函数
notion image

读写文本格式文件

pandas.read_csvpandas.read_table常用的选项
notion image
数据规整
type
status
date
slug
summary
tags
category
icon
password
Property

层次化索引

 
 
 
 
 
数据分组和聚合
type
status
date
slug
summary
tags
category
icon
password
Property
 
 
 
 
notion image

分组

  • by:根据什么进行分组,用于确定groupby的组
  • as_index:对于聚合输出,返回以组便签为索引的对象,仅对DataFrame