Python One-Liners: Write Code Like an Expert
Tags
Summary
Editor's review
Who it's for
A good fit for
- 已掌握 Python 基础语法,想突破「会写但写不好」瓶颈的学习者
- 准备面试、需要用简洁实现复习算法与数据结构的人
- 做数据分析、想更熟练使用 NumPy、列表解析与函数式写法的人
- 对正则表达式与机器学习算法的代码实现感兴趣的工程师
- 喜欢通过读代码、拆解代码来学习的自学者
Not a good fit for
- 完全没有编程经验的零基础读者,书中假设已有 Python 语法基础
- 希望系统学习 Python 工程规范、测试与项目架构的人
- 需要完整机器学习理论推导的读者,本书侧重代码实现而非数学证明
- 把书中一行代码直接照搬进生产项目的人
Reading tips
- 按章节顺序读,第1章务必读透,后面所有案例都建立在其语法基础上
- 每节先自己动手实现再对照书中代码,差异之处最能暴露理解盲点
- 准备一个 Jupyter 环境逐行运行并打印中间结果,验证拆解过程的每一步
- 读完一章后尝试用一行代码改写自己项目中的循环或数据清洗片段
About the publisher
The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.
Contents
- Introduction
- Examples of Python One-Liners
- A Note on Readability
- Who Is This Book For?
- What Will You Learn?
- Online Resources
- Chapter 1 Python Refresher
- Basic Data Structures
- Numerical Data Types and Structures
- Boolean Values
- Strings
- The None Keyword
- Container Data Types: Lists, Stacks, Sets, Dictionaries
- Membership Testing
- List and Dictionary Comprehensions
- Control Flow: if, else, and elif
- Loops
- Functions and Lambda Functions
- Chapter 2 Python Tricks
- Finding the Highest Earner with List Comprehensions
- Finding Words with High Information Value with List Comprehensions
- Reading Files
- Using the lambda and map Functions
- Finding Matching Substrings and Their Context with Slicing
- Chapter 3 Data Science
- Chapter 4 Machine Learning
- Chapter 5 Regular Expressions
- Chapter 6 Algorithms
- Afterword
FAQ
这本书适合零基础学 Python 的人吗?
书中的一行代码可以直接用在项目里吗?
读这本书需要哪些前置知识或工具?
这本书和市面上的 Python 进阶书有什么不同?
这本书讲 Python 2 还是 Python 3?
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.