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
Leverage the numerical and mathematical modules in Python and its standard library as well as popular open source numerical Python packages like NumPy, SciPy, FiPy, matplotlib and more. This fully revised edition, updated with the latest details of each package and changes to Jupyter projects, demonstrates how to numerically compute solutions and mathematically model applications in big data, cloud computing, financial engineering, business management and more. Numerical Python, Second Edition , presents many brand-new case study examples of applications in data science and statistics using Python, along with extensions to many previous examples. Each of these demonstrates the power of Python for rapid development and exploratory computing due to its simple and high-level syntax and multiple options for data analysis. After reading this book, readers will be familiar with many computing techniques including array-based and symbolic computing, visualization and numerical file I/O, equation solving, optimization, interpolation and integration, and domain-specific computational problems, such as differential equation solving, data analysis, statistical modeling and machine learning. W hat You´ll Learn Work with vectors and matrices using NumPy Plot and visualize data with Matplotlib Perform data analysis tasks with Pandas and SciPy Review statistical modeling and machine learning with statsmodels and scikit-learn Optimize Python code using Numba and Cython Who This Book Is For Developers who want to understand how to use Python and its related ecosystem for numerical computing.