Mastering Python Scientific Computing
eBook - ePub

Mastering Python Scientific Computing

Hemant Kumar Mehta

Condividi libro
  1. 300 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering Python Scientific Computing

Hemant Kumar Mehta

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

A complete guide for Python programmers to master scientific computing using Python APIs and tools

About This Book

  • The basics of scientific computing to advanced concepts involving parallel and large scale computation are all covered.
  • Most of the Python APIs and tools used in scientific computing are discussed in detail
  • The concepts are discussed with suitable example programs

Who This Book Is For

If you are a Python programmer and want to get your hands on scientific computing, this book is for you. The book expects you to have had exposure to various concepts of Python programming.

What You Will Learn

  • Fundamentals and components of scientific computing
  • Scientific computing data management
  • Performing numerical computing using NumPy and SciPy
  • Concepts and programming for symbolic computing using SymPy
  • Using the plotting library matplotlib for data visualization
  • Data analysis and visualization using Pandas, matplotlib, and IPython
  • Performing parallel and high performance computing
  • Real-life case studies and best practices of scientific computing

In Detail

In today's world, along with theoretical and experimental work, scientific computing has become an important part of scientific disciplines. Numerical calculations, simulations and computer modeling in this day and age form the vast majority of both experimental and theoretical papers. In the scientific method, replication and reproducibility are two important contributing factors. A complete and concrete scientific result should be reproducible and replicable. Python is suitable for scientific computing. A large community of users, plenty of help and documentation, a large collection of scientific libraries and environments, great performance, and good support makes Python a great choice for scientific computing.

At present Python is among the top choices for developing scientific workflow and the book targets existing Python developers to master this domain using Python. The main things to learn in the book are the concept of scientific workflow, managing scientific workflow data and performing computation on this data using Python.

The book discusses NumPy, SciPy, SymPy, matplotlib, Pandas and IPython with several example programs.

Style and approach

This book follows a hands-on approach to explain the complex concepts related to scientific computing. It details various APIs using appropriate examples.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering Python Scientific Computing è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering Python Scientific Computing di Hemant Kumar Mehta in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Negocios y empresa e Inteligencia empresarial. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783288823

Mastering Python Scientific Computing


Table of Contents

Mastering Python Scientific Computing
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. The Landscape of Scientific Computing – and Why Python?
Definition of scientific computing
A simple flow of the scientific computation process
Examples from scientific/engineering domains
A strategy for solving complex problems
Approximation, errors, and associated concepts and terms
Error analysis
Conditioning, stability, and accuracy
Backward and forward error analysis
Is it okay to ignore these errors?
Computer arithmetic and floating-point numbers
The background of the Python programming language
The guiding principles of the Python language
Why Python for scientific computing?
Compact and readable code
Holistic language design
Free and open source
Language interoperability
Portable and extensible
Hierarchical module system
Graphical user interface packages
Data structures
Python's testing framework
Available libraries
The downsides of Python
Summary
2. A Deeper Dive into Scientific Workflows and the Ingredients of Scientific Computing Recipes
Mathematical components of scientific computations
A system of linear equations
A system of nonlinear equations
Optimization
Interpolation
Extrapolation
Numerical integration
Numerical differentiation
Differential equations
The initial value problem
The boundary value problem
Random number generator
Python scientific computing
Introduction to NumPy
The SciPy library
The SciPy Subpackage
Data analysis using pandas
A brief idea of interactive programming using IPython
IPython parallel computing
IPython Notebook
Symbolic computing using SymPy
The features of SymPy
Why SymPy?
The plotting library
Summary
3. Efficiently Fabricating and Managing Scientific Data
The basic concepts of data
Data storage software and toolkits
Files
Structured files
Unstructured files
Database
Possible operations on data
Scientific data format
Ready-to-use standard datasets
Data generation
Synthetic data generation (fabrication)
Using Python's built-in functions for random number generation
Bookkeeping functions
Functions for integer random number generation
Functions for sequences
Statistical-distribution-based functions
Nondeterministic random number generator
Designing and implementing random number generators based on statistical distributions
A program with simple logic to generate five-digit random numbers
A brief note about large-scale datasets
Summary
4. Scientific Computing APIs for Python
Numerical scientific computing in Python
The NumPy package
The ndarrays data structure
File handling
Some sample NumPy programs
The SciPy package
The optimization package
The interpolation package
Integration and differential equations in SciPy
The stats module
Clustering package and spatial algorithms in SciPy
Image processing in SciPy
Sample SciPy programs
Statistics using SciPy
Optimization in SciPy
Image processing using SciPy
Symbolic computations using SymPy
Computer Algebra System
Features of a general-purpose CAS
A brief idea of SymPy
Core capability
Polynomials
Calculus
Solving equations
Discrete math
Matrices
Geometry
Plotting
Physics
Statistics
Printing
SymPy modules
Simple exemplary programs
Basic symbol manipulation
Expression expansion in SymPy
Simplification of an expression or formula
Simple integrations
APIs and toolkits for data analysis and visualization
Data analysis and manipulation using pandas
Important data structures of pandas
Special features of pandas
Data visualization using matplotlib
Interactive computing in Python using IPython
Sample data analysis and visualization programs
Summary
5. Performing Numerical Computing
The NumPy fundamental objects
The ndarray object
The attributes of an array
Basic operations on arrays
Special operations on arrays (shape change and conversion)
Classes associated with arrays
The matrix sub class
Masked array
The structured/recor array
The universal function object
Attributes
Methods
Various available ufunc
The NumPy mathematical modules
Introduction to SciPy
Mathematical functions in SciPy
Advanced modules/packages
Integration
Signal processing (scipy.signal)
Fourier transforms (scipy.fftpack)
Spatial data structures and algorithms (scipy.spatial)
Optimization (scipy.optimize)
Interpolation (scipy.interpolate)
Linear algebra (scipy.linalg)
Sparse eigenvalue problems with ARPACK
Statistics (scipy.stats)
Multidimensional image processing (scipy.ndimage)
Clustering
Curve fitting
File I/O (scipy.io)
Summary
6. Applying Python for Symbolic Computing
Symbols, expressions, and basic arithmetic
Equation solving
Functions for rational numbers, exponentials, and logarithms
Polynomials
Trigonometry and complex numbers
Linear algebra
Calculus
Vectors
The physics module
Hydrogen wave functions
Matrices and Pauli algebra
The quantum harmonic oscillator in 1-D and 3-D
Second quantization
High-energy Physics
Mechanics
Pretty printing
LaTeX Printing
The cryptography module
Parsing input
The logic module
The geometry module
Symbolic integrals
Polynomial manipulation
Sets
The simplify and collect operations
Summary
7. Data Analysis and Visualization
Matplotlib
The architecture of matplotlib
The scripting layer (pyplot)
The artist layer
The backend layer
Graphics with matplotlib
Output generation
The pandas library
Series
DataFrame
Panel
The common functionality among the data structures
Time series and date functions
Handling missing data
I/O operations
Working on CSV files
Ready-to-eat datasets
The pandas plotting
IPython
The IPython console and system shell
The operating system interface
Nonblocking plotting
Debugging
IPython Notebook
Summary
8. Parallel and Large-scale Scientific Computing
Parallel computing using IPython
The architecture of IPython parallel computing
The components of parallel computing
The IPython engine
The IPython controller
IPython view and interfaces
The IPython client
Example of performing parallel computing
A parallel decorator
IPython's magic functions
Activating specific views
Engines and QtConsole
Advanced features of IPython
Fault-tolerant execution
Dynamic load balancing
Pushing and pulling objects between clients and engines
Database support for storing the requests and results
Using MPI in IPython
Managing dependencies among tasks
Functional dependency
Decorators for functional dependency
Graph dependency
Impossible dependencies
The DAG dependency and the NetworkX library
Using IPython on an Amazon EC2 cluster with StarCluster
A note on security of IPython
Well-known parallel programming styles
Issues in parallel programming
Parallel programming
Concurrent programming
Distributed programming
Multiprocessing in Python
Multithreading in Python
Hadoop-based MapReduce in Python
Spark in Python
Summary
9. Revisiting Real-life Case Studies
Scientific computing applications developed in Python
The one Laptop per Child project used Python for their user interface
ExpEYES – eyes for science...

Indice dei contenuti