SciPy Recipes
- 386 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
SciPy Recipes
About This Book
Tackle the most sophisticated problems associated with scientific computing and data manipulation using SciPy
Key Features
- Covers a wide range of data science tasks using SciPy, NumPy, pandas, and matplotlib
- Effective recipes on advanced scientific computations, statistics, data wrangling, data visualization, and more
- A must-have book if you're looking to solve your data-related problems using SciPy, on-the-go
Book Description
With the SciPy Stack, you get the power to effectively process, manipulate, and visualize your data using the popular Python language. Utilizing SciPy correctly can sometimes be a very tricky proposition. This book provides the right techniques so you can use SciPy to perform different data science tasks with ease.
This book includes hands-on recipes for using the different components of the SciPy Stack such as NumPy, SciPy, matplotlib, and pandas, among others. You will use these libraries to solve real-world problems in linear algebra, numerical analysis, data visualization, and much more. The recipes included in the book will ensure you get a practical understanding not only of how a particular feature in SciPy Stack works, but also of its application to real-world problems. The independent nature of the recipes also ensure that you can pick up any one and learn about a particular feature of SciPy without reading through the other recipes, thus making the book a very handy and useful guide.
What you will learn
- Get a solid foundation in scientific computing using Python
- Master common tasks related to SciPy and associated libraries such as NumPy, pandas, and matplotlib
- Perform mathematical operations such as linear algebra and work with the statistical and probability functions in SciPy
- Master advanced computing such as Discrete Fourier Transform and K-means with the SciPy Stack
- Implement data wrangling tasks efficiently using pandas
- Visualize your data through various graphs and charts using matplotlib
Who this book is for
Python developers, aspiring data scientists, and analysts who want to get started with scientific computing using Python will find this book an indispensable resource. If you want to learn how to manipulate and visualize your data using the SciPy Stack, this book will also help you. A basic understanding of Python programming is all you need to get started.
Frequently asked questions
Information
Calculus, Interpolation, and Differential Equations
- Integration
- Computing integrals using a Gaussian quadrature
- Computing integrals with weighting functions
- Computing multiple integrals
- Interpolation
- Computing a polynomial interpolation for a set of data points
- Univariate interpolation
- Finding a cubic spline that interpolates a set of data
- Defining a B-spline for a given set of control points
- Differentiation
- Solving a one-dimensional ordinary differential equation
- Solving a system of ordinary differential equations
- Solving differential equations and systems with parameters
- Using ode and the objected-oriented interface to solve differential equations
Introduction
import numpy as np
from scipy.special import fresnel
import pylab
t = np.linspace(-10, 10, 1000)
pylab.plot(*fresnel(t), c='k')
pylab.show()
Integration
Getting ready
- To achieve the definite integration of functions on suitable domains, we have mainly two methodsānumerical integration and symbolic integration.
- Numerical integration refers to the approximation of a definite integral via a quadrature process. Depending on how the function f(x) is given, the domain of integration, the knowledge of its singularities, and the choice of quadrature is the main part of this section.
- In many cases, it is also possible to perform exact integration, even for non-bounded domains, with the aid of symbolic computation. In the SciPy stack, to this effect, we have an implementation of the Risch algorithm for elementary functions, and Meijer G-functions for non-elementary integrals. Both methods are housed in the SymPy libraries. Unfortunately, these symbolic procedures do not work for all functions, and due to the complexity of the generated codes in general, the solutions obtained by this method are by no means as fast as any numerical approximation.
How to do itā¦
- The definite integral of a polynomial function on a finite domain [a,b] can be computed very accurately via the fundamental theorem of calculus, using the numpy.polynomial module. For instance, to calculate the integral of the polynomial p(x)=x5 on the interval [-1,1].
- We could issue the fo...
Table of contents
- Title Page
- Copyright
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Preface
- Getting to Know the Tools
- Getting Started with NumPy
- Using Matplotlib to Create Graphs
- Data Wrangling with pandas
- Matrices and Linear Algebra
- Solving Equations and Optimization
- Constants and Special Functions
- Calculus, Interpolation, and Differential Equations
- Statistics and Probability
- Advanced Computations with SciPy