Book description
Tackle the most sophisticated problems associated with scientific computing and data manipulation using SciPy
About This Book
- 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
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.
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
In Detail
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.
Style and approach
This book consists of hands-on recipes where you'll deal with real-world problems.
You'll execute a series of tasks as you walk through scientific computing challenges using SciPy.
Your one-stop solution for common and not-so-common pain points, this is a book that you must have on the shelf.
Table of contents
- Preface
-
Getting to Know the Tools
- Introduction
- Installing Anaconda on Windows
- Installing Anaconda on macOS
- Installing Anaconda on Linux
- Checking the Anaconda installation
- Installing SciPy from a binary distribution on Windows
- Installing SciPy from a binary distribution on macOS
- Installing SciPy from source on Linux
- Installing optional packages with conda
- Installing packages with pip
- Setting up a virtual environment with conda
- Creating a virtual environment for development with conda
- Creating a conda environment with a different version of a package
- Using conda environments to run different versions of Python
- Creating virtual environments with venv
- Running SciPy in a script
- Running SciPy in Jupyter
- Running SciPy in Spyder
- Running SciPy in PyCharm
-
Getting Started with NumPy
- Introduction
-
Creating NumPy arrays
-
How to do it…
- Creating an array from a list
- Specifying the data type for elements in an array
- Creating an empty array with a given shape
- Creating arrays of zeros and ones with a single value
- Creating arrays with equally spaced values
- Creating an array by repeating elements
- Creating an array by tiling another array
- Creating an array with the same shape as another array
- Using object arrays to store heterogeneous data
- See also
-
How to do it…
- Querying and changing the shape of an array
- Storing and retrieving NumPy arrays
- Indexing
- Operations on arrays
- Using masked arrays to represent invalid data
- Using object arrays to store heterogeneous data
- Defining, symbolically, a function operating on arrays
-
Using Matplotlib to Create Graphs
- Introduction
- Creating two-dimensional plots of functions and data
- Generating multiple plots in a single figure
- Setting line styles and markers
- Using different backends to display graphs
- Saving plots to disk
- Annotating graphs
- Generating histograms and box plots
- Creating three-dimensional plots
- Generating interactive displays in the Jupyter Notebook
- Object-oriented graph creation using Artist objects
- Creating a map with cartopy
-
Data Wrangling with pandas
- Creating Series objects
- Creating DataFrame objects
- Inserting and deleting columns to a DataFrame
- Inserting and deleting rows to a DataFrame
- Selecting items by row indexes and column labels
- Selecting items by integer location
- Selecting items using mixed indexing
- Accessing, selecting, and modifying data
- Selecting rows using Boolean selection
- Reading and storing data in different formats
- Data displays employing different kinds of visual representation
- How to apply numerical functions and operations to Series and DataFrame objects
- Computing statistical functions on Series and DataFrame objects
- How to sort data in Series and DataFrame objects
- Performing merging, joins, concatenation, and grouping
-
Matrices and Linear Algebra
- Introduction
- Matrix operations and functions on two-dimensional arrays
- Solving linear systems using matrices
- Calculating the null space of a matrix
- Calculating the LU decompositions of a matrix
- Calculating the QR decomposition of a matrix
- Calculating the eigenvalue and eigenvector of a matrix
- Diagonalizing a matrix
- Calculating the Jordan form of a matrix
- Calculating the singular value decomposition of a matrix
- Creating a sparse matrix
- Computations on top of a sparse matrix
-
Solving Equations and Optimization
- Introduction
- Non-linear equations and systems
- System of equations and how to solve it
- Choosing the solver used to find the solution of equations
- Solving constrained non-linear optimization problems in several variables
- Solving one-dimensional optimization problems
- Solving multidimensional non-linear equations using the Newton-Krylov method
- Solving multidimensional non-linear equations using the Anderson method
- Finding the best linear fit for a set of data
- Doing non-linear regression for a set of data
- Regression
- Constants and Special Functions
-
Calculus, Interpolation, and Differential Equations
- Introduction
- 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
-
Statistics and Probability
- Introduction
- Computing the probability mass function of a discrete random variable
- Computing the probability density function of a continuous random variable
- Computing the cumulative distribution function for a random variable
- Computing the values of inverse probabilities associated with a random variable
- Computing the average, standard deviation, and higher moments of a distribution
- Computing probabilities associated with the multivariate Gaussian distribution
- Computing the summary statistics of a dataset
-
Advanced Computations with SciPy
- Discrete Fourier transforms
- Computing the discrete Fourier transform (DFT) of a data series using the FFT algorithm
- Computing the inverse DFT of a data series
- Computing signal construction
- Getting started with filters
- Computing the DFT for two-dimensional data
- How to find the DFT of the derivative of a function
- Computing the convolution of two functions
- Mathematical imaging
- Computing pairwise distances from a dataset, using different distance metrics
- How to identify neighborhoods and nearest neighbors for a dataset and a given metric
- Nearest neighbors regression
Product information
- Title: SciPy Recipes
- Author(s):
- Release date: December 2017
- Publisher(s): Packt Publishing
- ISBN: 9781788291460
You might also like
book
Scientific Computing with Python 3
An example-rich, comprehensive guide for all of your Python computational needs About This Book Your ultimate …
book
Applying Math with Python
Discover easy-to-follow solutions and techniques to help you to implement applied mathematical concepts such as probability, …
book
Age-Period-Cohort Analysis
This book explores the ways in which statistical models, methods, and research designs can be used …
book
Python Data Analysis Cookbook
Over 140 practical recipes to help you make sense of your data with ease and build …