Python How-To: 63 Techniques to Improve Your Python Code
暫譯: Python 實用技巧:63 種提升 Python 代碼的技術

Cui, Yong

  • 出版商: Manning
  • 出版日期: 2023-08-04
  • 定價: $1,800
  • 售價: 9.0$1,620
  • 語言: 英文
  • 頁數: 504
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 161729974X
  • ISBN-13: 9781617299742
  • 相關分類: Python程式語言
  • 立即出貨 (庫存 < 4)

買這商品的人也買了...

相關主題

商品描述

Have you ever asked yourself, "How do I do that in Python?" If so, you'll love this practical collection of the most important Python techniques.

Python How-To includes over 60 detailed answers to questions like:

 

  • How do I join and split strings?
  • How do I access dictionary keys, values, and items?
  • How do I set and use the return value in function calls?
  • How do I process JSON data?
  • How do I create lazy attributes to improve performance?
  • How do I change variables in a different namespace?


...and much more

Python How-To walks you through the most important coding techniques in Python. Whether you're doing data science, building web applications, or writing admin scripts, you'll find answers to your "how-to" questions in this book. Inside you'll find important insights into both Python basics and deep-dive topics to help you skill-up at any stage of your Python career. Author Yong Cui's clear and practical writing is instantly accessible and makes it easy to take advantage of Python's versatile tools and libraries. Perfect to be read both from cover to cover, and whenever you need help troubleshooting your code.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

Python How-To uses a simple but powerful method to lock in 63 core Python skills. You'll start with a question, like "How do I find items in a sequence?" Next, you'll see an example showing the basic solution in crystal-clear code. You'll then explore interesting variations, such as finding substrings or identifying custom classes. Finally, you'll practice with a challenge exercise before moving on to the next How-To.

About the Book

This practical guide covers all the language features you'll need to get up and running with Python. As you go, you'll explore best practices for writing great Python code. Practical suggestions and engaging graphics make each important technique come to life. Author Yong Cui's careful cross-referencing reveals how you can reuse features and concepts in different contexts.

What's Inside

How to:

 

  • Join and split strings
  • Access dictionary keys, values, and items
  • Set and use the return value in function calls
  • Process JSON data
  • Create lazy attributes to improve performance
  • Change variables in a different namespace


...and much more.

About the Reader

For beginning to intermediate Python programmers.

About the Author

Dr. Yong Cui has been working with Python in bioscience for data analysis, machine learning, and tool development for over 15 years.

Table of Contents

1 Developing a pragmatic learning strategy
PART 1 - USING BUILT-IN DATA MODELS
2 Processing and formatting strings
3 Using built-in data containers
4 Dealing with sequence data
5 Iterables and iterations
PART 2 - DEFINING FUNCTIONS
6 Defining user-friendly functions
7 Using functions beyond the basics
PART 3 - DEFINING CLASSES
8 Defining user-friendly classes
9 Using classes beyond the basics
PART 4 - MANIPULATING OBJECTS AND FILES
10 Fundamentals of objects
11 Dealing with files
PART 5 - SAFEGUARDING THE CODEBASE
12 Logging and exception handling
13 Debugging and testing
PART 6 - BUILDING A WEB APP
14 Completing a real project

商品描述(中文翻譯)

你是否曾經問過自己,「我該如何在 Python 中做到這一點?」如果是的話,你會喜歡這本實用的 Python 技術精華集。

Python How-To 包含超過 60 個詳細的問題解答,例如:


  • 我該如何連接和拆分字串?

  • 我該如何訪問字典的鍵、值和項目?

  • 我該如何設置和使用函數調用中的返回值?

  • 我該如何處理 JSON 數據?

  • 我該如何創建延遲屬性以提高性能?

  • 我該如何在不同的命名空間中更改變數?



...還有更多內容

Python How-To 帶你了解 Python 中最重要的編碼技術。無論你是在進行數據科學、構建網頁應用程序,還是編寫管理腳本,你都能在這本書中找到對於「如何做」問題的答案。書中提供了對 Python 基礎和深入主題的重要見解,幫助你在 Python 職業生涯的任何階段提升技能。作者 Yong Cui 的清晰且實用的寫作風格使內容易於理解,並能輕鬆利用 Python 的多功能工具和庫。這本書非常適合從頭到尾閱讀,也適合在需要幫助排除代碼故障時隨時查閱。

購買印刷版書籍可獲得 Manning Publications 提供的免費 PDF、Kindle 和 ePub 格式電子書。

關於技術

Python How-To 使用一種簡單但強大的方法來鎖定 63 種核心 Python 技能。你將從一個問題開始,例如「我該如何在序列中查找項目?」接下來,你將看到一個示例,展示清晰的基本解決方案。然後,你將探索有趣的變體,例如查找子字串或識別自定義類。最後,你將在進入下一個 How-To 之前進行挑戰練習。

關於這本書

這本實用指南涵蓋了你需要掌握 Python 的所有語言特性。在學習過程中,你將探索編寫優秀 Python 代碼的最佳實踐。實用的建議和引人入勝的圖形使每個重要技術生動呈現。作者 Yong Cui 的仔細交叉引用揭示了如何在不同上下文中重用特性和概念。

內容概覽

如何:


  • 連接和拆分字串

  • 訪問字典的鍵、值和項目

  • 設置和使用函數調用中的返回值

  • 處理 JSON 數據

  • 創建延遲屬性以提高性能

  • 在不同的命名空間中更改變數



...還有更多。

關於讀者

適合初學者到中級的 Python 程式設計師。

關於作者

Dr. Yong Cui 在生物科學領域從事 Python 數據分析、機器學習和工具開發工作已有超過 15 年的經驗。

目錄

1 開發務實的學習策略

PART 1 - 使用內建數據模型

2 處理和格式化字串

3 使用內建數據容器

4 處理序列數據

5 可迭代對象和迭代

PART 2 - 定義函數

6 定義用戶友好的函數

7 超越基礎的函數使用

PART 3 - 定義類

8 定義用戶友好的類

9 超越基礎的類使用

PART 4 - 操作對象和文件

10 對象的基本原理

11 處理文件

PART 5 - 保護代碼庫

12 日誌記錄和異常處理

13 調試和測試

PART 6 - 構建網頁應用

14 完成一個真實的項目