Cython: A Guide for Python Programmers

Kurt W. Smith

  • 出版商: O'Reilly
  • 出版日期: 2015-02-24
  • 定價: $1,160
  • 售價: 9.5$1,102
  • 貴賓價: 9.0$1,044
  • 語言: 英文
  • 頁數: 254
  • 裝訂: Paperback
  • ISBN: 1491901551
  • ISBN-13: 9781491901557
  • 相關分類: Python
  • 立即出貨 (庫存 < 4)

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

相關主題

商品描述

Build software that combines Python’s expressivity with the performance and control of C (and C++). It’s possible with Cython, the compiler and hybrid programming language used by foundational packages such as NumPy, and prominent in projects including Pandas, h5py, and scikits-learn. In this practical guide, you’ll learn how to use Cython to improve Python’s performance—up to 3000x— and to wrap C and C++ libraries in Python with ease.

Author Kurt Smith takes you through Cython’s capabilities, with sample code and in-depth practice exercises. If you’re just starting with Cython, or want to go deeper, you’ll learn how this language is an essential part of any performance-oriented Python programmer’s arsenal.

  • Use Cython’s static typing to speed up Python code
  • Gain hands-on experience using Cython features to boost your numeric-heavy Python
  • Create new types with Cython—and see how fast object-oriented programming in Python can be
  • Effectively organize Cython code into separate modules and packages without sacrificing performance
  • Use Cython to give Pythonic interfaces to C and C++ libraries
  • Optimize code with Cython’s runtime and compile-time profiling tools
  • Use Cython’s prange function to parallelize loops transparently with OpenMP

商品描述(中文翻譯)

建構結合Python的表達能力與C(和C++)的效能和控制的軟體。這是可能的,因為有Cython,這個編譯器和混合程式語言被NumPy等基礎套件使用,並在Pandas、h5py和scikits-learn等專案中佔有重要地位。在這本實用指南中,您將學習如何使用Cython來提升Python的效能,甚至可以提升3000倍,並輕鬆地將C和C++函式庫封裝成Python。

作者Kurt Smith帶您深入了解Cython的功能,並提供示範程式碼和深入的練習。無論您是初次接觸Cython,還是想更深入了解,您都將學習到這個語言是任何以效能為導向的Python程式設計師必備的工具。

- 使用Cython的靜態類型來加速Python程式碼
- 透過使用Cython功能來提升數值計算密集型Python程式的實戰經驗
- 使用Cython創建新的類型,並體驗Python中面向物件編程的高效能
- 有效地將Cython程式碼組織成獨立的模組和套件,同時不損失效能
- 使用Cython為C和C++函式庫提供Pythonic介面
- 使用Cython的執行時和編譯時分析工具來優化程式碼
- 使用Cython的prange函數透明地使用OpenMP並行化迴圈