Skip to Content
利用 Python 进行数据分析:原书第 3 版
book

利用 Python 进行数据分析:原书第 3 版

by Wes McKinney
November 2023
Intermediate to advanced
512 pages
11h 53m
Chinese
China Machine Press
Content preview from 利用 Python 进行数据分析:原书第 3 版
448
|
附录
A
A-1
中列出了所有关于拼接和拆分的函数,其中一些仅作为通用 concatenate 的便捷
方法。
A-1:数组拼接和拆分函数
函数 说明
concatenate
最通用的函数
沿特定轴拼接数组集合
vstack row_stack
按行堆叠数组
沿着轴 0
hstack
按列堆叠数组
沿着轴 1
column_stack
类似于 hstack
但是会先将一维数组转换为二维列向量
dstack
深度
堆叠数组
沿着轴 2
split
沿指定轴
在传入的位置拆分数组
hsplit/vsplit
分别沿轴 0
1 进行拆分的便捷函数
堆叠辅助方法:
r_
c_
NumPy
命名空间中有两个特殊的对象 r_ c_,它们可以使数组的堆叠操作更简洁:
它们还可以将切片转换成数组:
高阶
NumPy
|
449
r_ c_ 的具体功能请参考其文档字符串。
A.2.4
元素的重复操作:
tile
repeat
对数组进行重复操作或复制数组以生成更大数组的工具,主要是 repeat tile 这两个
函数。repeat 会将数组中的各个元素重复一定次数,从而产生一个更大的数组:
与其他流行的数组编程语言(如
MATLAB
)不同,
NumPy
中很少需要对数
组进行复制或重复。这主要是因为广播机制能更好地满足该需求 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Effective Python 第3版 ―Pythonプログラムを改良する125項目

Effective Python 第3版 ―Pythonプログラムを改良する125項目

Brett Slatkin, 鈴木 駿

Publisher Resources

ISBN: 9787111726722