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 版
484
|
附录
B
时候会非常方便。例如,假设你想创建一个指向本书补充内容的书签:
完成上面这步之后,使用魔术命令 %cd 就可以使用定义过的任意书签了:
如果书签名与当前工作路径中的某个路径重名,可以使用标志 -b 进行覆盖并使用书签
的位置。使用 %bookmark -l,可以列出所有书签:
书签和别名不同,在
IPython
会话之间是自动保存的。
B.5
软件开发工具
除了作为交互式计算和数据探索的舒适环境,
IPython
也是有效的
Python
软件开发通
用工具。在数据分析任务中,最重要的是要有正确的代码。幸运的是,
IPython
紧密集
成并强化了
Python
内置的 pdb 调试器。其次,你希望你的代码运行更快。对于这点,
IPython
集成了方便进行代码计时和分析的工具。我会详细介绍这些工具。
B.5.1
交互式调试器
IPython
的调试器用
tab
补全、语法增强、逐行上下文异常回溯强化了 pdb。调试代码的
最佳时机就是错误刚刚发生之后。异常发生之后就输入命令 %debug,会启动“事后分
析”的调试器,并进入抛出异常的栈帧:
更多关于
IPython
的内容
|
485
一旦进入调试器,就可以执行任意的
Python
代码,并能在每个栈帧中探索所有的对象和
数据(解释器会将其保持为“运行状态”)。默认是从发生异常的最底层开始。通过键入 ...
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