Python: From Beginner to Hands-On Artificial Intelligence cover

Python: From Beginner to Hands-On Artificial Intelligence

Rating 3.2
Word count
100K words
Chapters
177
ISBN
9787301312841

Tags

Summary

Python from Beginner to AI in Practice is a tutorial written for learners with no programming background. Taking a beginner's perspective, each chapter is problem-oriented and supported by numerous examples, offering a detailed introduction to Python fundamentals, machine learning, and the two most accessible platforms for learning: PyTorch and Keras.

The book has 20 chapters, covering Python installation and configuration, Python language basics, flow control statements, sequences, functions, objects, files and exception handling, key modules for data processing and analysis (NumPy, Pandas), machine learning fundamentals, common machine learning tuning methods, neural networks, convolutional neural networks, and multiple hands-on AI case studies implemented with PyTorch and Keras. All knowledge in the book is explained through concrete examples, and the program code involved is given detailed comments so that readers can grasp it with ease.

Editor's review

This is a Python tutorial for beginners that covers everything from language fundamentals to hands-on artificial intelligence projects. It is problem-oriented, with each chapter featuring numerous examples and code accompanied by detailed comments, lowering the barrier for beginners. The content first covers installation and configuration, syntax, flow control, sequences, functions, objects, files, and exceptions; then moves to data processing with NumPy and Pandas; next, the basics of machine learning and tuning methods, neural networks, and convolutional neural networks; and finally, multiple hands-on cases using PyTorch and Keras. For readers who want a single path through "learn the language—work with data—run models," this structure saves the trouble of switching among multiple books. Note that the book is substantial; beginners should not expect to finish it in one pass but should instead type the code along with each chapter and run each chapter's examples successfully before moving on. Positioned between introductory and practical, it does not delve into theoretical derivations and does not replace systematic mathematics and algorithms textbooks.

Who it's for

A good fit for

  • Beginners with no programming background who want a systematic introduction to Python
  • Learners with basic syntax knowledge who want to complete the chain from data processing to machine learning
  • Practical readers who want to run their first AI case with PyTorch or Keras
  • University students using it as course companion material or for self-study practice

Not a good fit for

  • Developers with extensive Python and deep learning experience seeking advanced techniques
  • Theoretical readers who want in-depth derivations of machine learning mathematics
  • Reference-oriented users who only want to look up syntax quickly without doing exercises

Reading tips

  1. Proceed chapter by chapter, and be sure to run each chapter's examples hands-on before moving to the next chapter.
  2. Skim the fundamentals, but slow down and take notes on NumPy, Pandas, and the hands-on chapters.
  3. Prepare a small project of your own and apply the data processing and modeling methods you have learned.
  4. When reading the hands-on cases, first cover the code and try it yourself, then compare with the book's implementation to find gaps.

About the publisher

Peking University Press China · Founded in 1979

Peking University Press is a comprehensive university press whose publishing areas cover classical literature, popular science, social culture, world history, Western philosophy, and culture. Its catalogue contains 6,031 titles, with representative books including A Dream of Red Mansions, Relativity: The Special and General Theory (15th Edition) (with Einstein's classic papers on unified field theory and other topics), Elements, Conics, The Aristocratic Families of the Eastern Jin, The Philosophy of Mythology (Volume I), The Philosophy of Mythology (Volume II), and The Origin of Continents and Oceans. Representative authors include Cao Xueqin, Zhou Ruchang, Albert Einstein, Euclid, Apollonius, Tian Yuqing, Schelling, and Xian Gang. The press has developed distinctive strengths in classical Chinese literature and in the translation of Western philosophical classics, while also covering scientific classics and social and cultural studies. As public information is limited, this description is based only on the books in the catalogue and offers no further extrapolation.

Contents

  1. 版权信息
  2. 前言
  3. 第1章 Python安装配置
  4. 1.1 问题:Python能带来哪些优势?
  5. 1.2 安装Python
  6. 1.3 配置开发环境
  7. 1.4 试运行Python
  8. 1.5 后续思考
  9. 1.6 小结
  10. 第2章 变量和数据类型
  11. 2.1 问题:Python是如何定义变量的?
  12. 2.2 变量
  13. 2.3 字符串
  14. 2.4 数字与运算符
  15. 2.5 数据类型转换
  16. 2.6 注释
  17. 2.7 后续思考
  18. 2.8 小结
  19. 第3章 列表和元组
  20. 3.1 问题:如何存取更多数据?
  21. 3.2 列表概述
  22. 3.3 访问列表元素的方法
  23. 3.4 对列表进行增、删、改
  24. 3.5 统计分析列表
  25. 3.6 组织列表
  26. 3.7 生成列表
  27. 3.8 元组
  28. 3.9 后续思考
  29. 3.10 小结
  30. 第4章 if语句与循环语句
  31. 4.1 问题:Python中的控制语句有何特点?
  32. 4.2 if语句
  33. 4.3 循环语句
  34. 4.4 后续思考
  35. 4.5 小结
  36. 第5章 字典和集合
  37. 5.1 问题:当索引不好用时怎么办?
  38. 5.2 一个简单的字典实例
  39. 5.3 创建和维护字典
  40. 5.4 遍历字典
  41. 5.5 集合
  42. 5.6 列表、元组、字典和集合的异同
  43. 5.7 迭代器和生成器
  44. 5.8 后续思考
  45. 5.9 小结
  46. 第6章 函数
  47. 6.1 问题:如何实现代码共享?
  48. 6.2 创建和调用函数
  49. 6.3 传递参数
  50. 6.4 返回值
  51. 6.5 传递任意数量的参数
  52. 6.6 lambda函数
  53. 6.7 生成器函数
  54. 6.8 把函数放在模块中
  55. 6.9 后续思考
  56. 6.10 小结
  57. 第7章 面向对象编程
  58. 7.1 问题:如何实现不重复造轮子?
  59. 7.2 类与实例
  60. 7.3 继承
  61. 7.4 把类放在模块中
  62. 7.5 标准库
  63. 7.6 包
  64. 7.7 实例1:使用类和包
  65. 7.8 实例2:银行ATM机系统
  66. 7.9 后续思考
  67. 7.10 小结
  68. 第8章 文件与异常
  69. 8.1 问题:Python如何获取文件数据?
  70. 8.2 基本的文件操作
  71. 8.3 目录操作
  72. 8.4 异常处理
  73. 8.5 后续思考
  74. 8.6 小结
  75. 第9章 NumPy基础
  76. 9.1 问题:为什么说NumPy是打开人工智能的一把钥匙?
  77. 9.2 生成NumPy数组
  78. 9.3 获取元素
  79. 9.4 NumPy的算术运算
  80. 9.5 数组变形
  81. 9.6 通用函数
  82. 9.7 广播机制
  83. 9.8 后续思考
  84. 9.9 小结
  85. 第10章 Pandas基础
  86. 10.1 问题:Pandas有哪些优势?
  87. 10.2 Pandas数据结构
  88. 10.3 Series
  89. 10.4 DataFrame
  90. 10.5 后续思考
  91. 10.6 小结
  92. 第11章 数据可视化
  93. 11.1 问题:为何选择Matplotlib?
  94. 11.2 可视化工具Matplotlib
  95. 11.3 绘制多个子图
  96. 11.4 Seaborn简介
  97. 11.5 图像处理与显示
  98. 11.6 Pyecharts简介
  99. 11.7 实例:词云图
  100. 11.8 后续思考
  101. 11.9 小结
  102. 第12章 机器学习基础
  103. 12.1 问题:机器学习如何学习?
  104. 12.2 机器学习常用算法
  105. 12.3 机器学习的一般流程
  106. 12.4 机器学习常用技巧
  107. 12.5 实例1:机器学习是如何学习的?
  108. 12.6 实例2:用Scikit-Learn实现电信客户流失预测
  109. 12.7 后续思考
  110. 12.8 小结
  111. 第13章 神经网络
  112. 13.1 问题:神经网络能代替传统机器学习吗?
  113. 13.2 单层神经网络
  114. 13.3 多层神经网络
  115. 13.4 输出层
  116. 13.5 损失函数
  117. 13.6 正向传播
  118. 13.7 误差反向传播
  119. 13.8 实例:用Python实现手写数字的识别
  120. 13.9 后续思考
  121. 13.10 小结
  122. 第14章 用PyTorch实现神经网络
  123. 14.1 为何选择PyTorch?
  124. 14.2 安装配置
  125. 14.3 Tensor简介
  126. 14.4 autograd机制
  127. 14.5 构建神经网络的常用工具
  128. 14.6 数据处理工具
  129. 14.7 实例1:用PyTorch实现手写数字识别
  130. 14.8 实例2:用PyTorch解决回归问题
  131. 14.9 小结
  132. 第15章 卷积神经网络
  133. 15.1 问题:传统神经网络有哪些不足?
  134. 15.2 卷积神经网络
  135. 15.3 实例:用PyTorch完成图像识别任务
  136. 15.4 后续思考
  137. 15.5 小结
  138. 第16章 提升模型性能的几种技巧
  139. 16.1 问题:为什么有些模型尝试了很多方法仍然效果不佳?
  140. 16.2 找到合适的学习率
  141. 16.3 正则化
  142. 16.4 合理的初始化
  143. 16.5 选择合适的优化器
  144. 16.6 GPU加速
  145. 16.7 后续思考
  146. 16.8 小结
  147. 第17章 Keras入门
  148. 17.1 问题:为何选择Keras架构?
  149. 17.2 Keras简介
  150. 17.3 Keras常用概念
  151. 17.4 Keras常用层
  152. 17.5 神经网络核心组件
  153. 17.6 Keras的开发流程
  154. 17.7 实例:Keras程序的开发流程
  155. 17.8 后续思考
  156. 17.9 小结
  157. 第18章 用Keras实现图像识别
  158. 18.1 实例1:用自定义模型识别手写数字
  159. 18.2 实例2:用预训练模型识别图像
  160. 18.3 后续思考
  161. 18.4 小结
  162. 第19章 用Keras实现迁移学习
  163. 19.1 问题:如何发挥小数据的潜力?
  164. 19.2 迁移学习简介
  165. 19.3 迁移学习常用方法
  166. 19.4 实例:用Keras实现迁移学习
  167. 19.5 后续思考
  168. 19.6 小结
  169. 第20章 用Keras实现风格迁移
  170. 20.1 问题:如何捕捉图像风格?
  171. 20.2 通道与风格
  172. 20.3 内容损失与风格损失
  173. 20.4 格拉姆矩阵简介
  174. 20.5 实例:用Kreras实现风格迁移
  175. 20.6 后续思考
  176. 20.7 小结
  177. 下载链接

FAQ

Can I read this book if I have never programmed before?
Yes. The book starts with Python installation and configuration and the basics of the language, assuming no prior programming experience, and the examples come with detailed comments. Complete beginners will, however, need to set aside ample time for hands-on practice. Skipping the exercises and merely reading the text makes it hard to truly master the material, so run the code for each chapter yourself.
What math background does the machine learning section require?
The book focuses on applications and examples rather than mathematical derivations; a high school math background is usually enough to follow the operational side. To understand the principles behind the models, you will still need to supplement linear algebra and probability and statistics, which this book does not cover.
What level will I reach after finishing this book?
You will grasp basic Python syntax and common data processing modules, understand the basic machine learning workflow and common tuning methods, and be able to run the book's practical cases with PyTorch and Keras. This is an intermediate level between beginner and hands-on practice; you will still be some distance from independently designing complex models.
What software environment do I need to install in advance?
Chapter 1 introduces Python installation and configuration; just follow its steps. Later chapters involve libraries such as NumPy, Pandas, PyTorch, and Keras, and the book explains how to install and use them. Configure them progressively as you follow the chapters; there is no need to install everything at the start.

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.

About the author

吴茂贵 Author

Wu Maogui — public information about this author is limited, and no authoritative account of their identity or background is available. Their writing direction can nonetheless be inferred from the two works held in the collection, both in computing and artificial intelligence: AIGC Principles and Practice: Learning Large Language Models, Diffusion Models, and Multimodal Models from Scratch, and From Python Basics to AI in Practice. The first introduces generative AI to beginners, explaining the principles of large language models, diffusion models, and multimodal models while guiding readers through hands-on practice; the second starts from Python and gradually moves toward applied artificial intelligence. Both emphasize a path from fundamentals to practical work, using accessible language suited to readers without prior background. Wu Maogui's writing thus tends to break complex technologies into actionable introductory material, combining conceptual explanation with exercises for newcomers to the field.

王红星 Author

Public information about Wang Hongxing is limited, and what is available comes mainly from works published under this name. Four titles are held in the collection, spanning a notably wide range of subjects: practical medical reading for grassroots audiences such as Appropriate Community Rehabilitation Techniques; inspirational and personal-growth compilations such as The Carnegie Quartet and The Art of Carnegie Communication and the Wisdom of Conducting Oneself (new edition); and an introductory technology book, Python from Beginner to AI in Practice. These works suggest a style of writing oriented toward popularizing knowledge and offering practical guidance for general readers, with an emphasis on applicability across fields including health and rehabilitation, interpersonal communication, and introductory programming. As the author's dates of birth and death, nationality, and professional background are unknown, a full personal profile cannot be drawn; the works above are the only basis for understanding the direction of this author's writing.

刘未昕 Author

Liu Weixin is a Chinese-language author of technical books active in the fields of programming design and artificial intelligence. Publicly available information about him is limited, and details such as his nationality, dates of birth and death, and English name remain unknown. Judging from the three works held in the collection, his writing focuses on turning technical knowledge into actionable practice: Build Your Own Big Data System (2nd Edition) guides readers in building a data system from scratch, Database Application in Practice centers on the practical use of databases, and From Python Basics to AI in Practice links language fundamentals with intelligent applications in one continuous path. Overall, these works are hands-on, step-by-step, and oriented toward real projects, making them suitable for beginners and intermediate readers who prefer learning by doing. They thus give him a fairly clear practice-oriented position among books on programming and artificial intelligence.

胡振兴 Author

Hu Zhenxing is a Chinese author of computer books, about whom publicly available information is currently limited. Judging from the two works held in the collection, Practical Database Applications and From Python Basics to Hands-On Artificial Intelligence, his writing focuses on programming design and artificial intelligence. The content is generally aimed at beginners and practical application, covering database operations and Python programming while extending to the implementation of artificial intelligence. Wording such as “practical” and “from basics to” in the titles suggests an approach that progresses from simple to advanced material and combines explanation with concrete operations, making the books suitable for beginners and self-learners who wish to get started quickly and learn by doing. Since the author's nationality, dates of birth and death, education, and professional background are not clearly documented, no speculation is made here; based solely on the existing works, the topics meet the practical needs of technology learners and offer useful reference value among introductory programming and applied artificial intelligence books.

More by the same author

Top rated in the same category