SciPy recipes a cookbook with over 110 proven recipes for performing mathematical and scientific computations
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 v...
Otros Autores: | , , |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt
2017.
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631650506719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: Getting to Know the Tools
- Introduction
- Installing Anaconda on Windows
- How to do it...
- Installing Anaconda on macOS
- How to do it...
- Installing Anaconda on Linux
- How to do it...
- Checking the Anaconda installation
- How to do it...
- Installing SciPy from a binary distribution on Windows
- How to do it...
- Installing Python
- Installing the SciPy stack
- Installing SciPy from a binary distribution on macOS
- How to do it...
- Installing the Xcode command-line tools
- Installing Homebrew
- Installing Python 3
- Installing the SciPy stack
- Installing SciPy from source on Linux
- How to do it...
- Installing Python 3
- Installing the SciPy stack
- Installing optional packages with conda
- Getting ready
- How to do it...
- Installing packages with pip
- How to do it...
- Setting up a virtual environment with conda
- Getting ready
- How to do it...
- Creating a virtual environment for development with conda
- Getting ready
- How to do it...
- Creating a conda environment with a different version of a package
- Getting ready
- How to do it...
- Using conda environments to run different versions of Python
- Getting ready
- How to do it...
- Creating virtual environments with venv
- How to do it...
- Running SciPy in a script
- Getting ready
- How to do it...
- Running SciPy in Jupyter
- Getting ready
- How to do it...
- Running SciPy in Spyder
- Getting ready
- How to do it...
- Running SciPy in PyCharm
- Getting started
- How to do it...
- Chapter 2: 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
- Querying and changing the shape of an array
- How to do it...
- Storing and retrieving NumPy arrays
- How to do it...
- Storing a NumPy array in text format
- Storing a NumPy array in CSV format
- Loading an array from a text file
- Storing a single array in binary format
- Storing several arrays in binary format
- Loading arrays stored in NPY binary format
- Indexing
- How to do it...
- Accessing sub arrays using slices
- Selecting subarrays using an index list
- Indexing with Boolean arrays
- Operations on arrays
- How to do it...
- Computing a function for all elements of an array
- Doing array operations
- Computing matrix products
- Using masked arrays to represent invalid data
- How to do it...
- Creating a masked array from an explicit mask
- Creating a masked array from a condition
- Using object arrays to store heterogeneous data
- How to do it...
- Defining, symbolically, a function operating on arrays
- Getting ready
- How to do it...
- How it works...
- Chapter 3: Using Matplotlib to Create Graphs
- Introduction
- Creating two-dimensional plots of functions and data
- Getting ready
- How to do it…
- How it works…
- Generating multiple plots in a single figure
- Getting ready
- How to do it…
- How it works…
- Setting line styles and markers
- Getting ready
- How to do it…
- How it works…
- Using different backends to display graphs
- Getting ready
- How to do it…
- How it works….
- Saving plots to disk
- Getting ready
- How to do it…
- How it works…
- Annotating graphs
- Getting ready
- How to do it…
- How it works…
- Generating histograms and box plots
- Getting ready
- How to do it…
- How it works…
- Creating three-dimensional plots
- Getting ready
- How to do it…
- How it works…
- Generating interactive displays in the Jupyter Notebook
- Getting ready
- How to do it…
- How it works…
- Object-oriented graph creation using Artist objects
- Getting ready
- How to do it…
- How it works…
- Creating a map with cartopy
- Getting ready
- How to do it…
- How it works…
- Chapter 4: Data Wrangling with pandas
- Creating Series objects
- Getting ready
- How to do it...
- How it works...
- Creating DataFrame objects
- Getting ready
- How to do it...
- How it works...
- Inserting and deleting columns to a DataFrame
- Getting ready
- How to do it...
- How it works...
- Inserting and deleting rows to a DataFrame
- Getting ready
- How to do it...
- How it works...
- Selecting items by row indexes and column labels
- Getting ready
- How to do it...
- How it works...
- Selecting items by integer location
- Getting ready
- How to do it...
- How it works...
- Selecting items using mixed indexing
- Getting ready
- How to do it...
- How it works...
- Accessing, selecting, and modifying data
- Getting ready
- How to do it...
- How it works...
- Selecting rows using Boolean selection
- How to do it...
- Reading and storing data in different formats
- Getting ready
- How to do it...
- Working with CSV, text/tabular, and format data
- How it works...
- Reading a CSV file into a DataFrame
- Specifying the index column when reading a CSV file
- Reading and writing data in Excel format
- Reading and writing JSON files
- Reading HTML data from the web
- Accessing CSV data on the web.
- Reading and writing from/to SQL databases
- Data displays employing different kinds of visual representation
- Getting ready
- How to do it...
- How it works...
- How to apply numerical functions and operations to Series and DataFrame objects
- Getting ready
- How to do it...
- How it works...
- Computing statistical functions on Series and DataFrame objects
- Getting ready
- How to do it...
- Retrieving summary descriptive statistics
- How it works...
- Calculating the mean
- Calculating variance and standard deviation
- How to sort data in Series and DataFrame objects
- Getting ready
- How to do it...
- How it works...
- Performing merging, joins, concatenation, and grouping
- Getting ready
- How to do it...
- How it works...
- Merging data from multiple pandas objects
- Chapter 5: Matrices and Linear Algebra
- Introduction
- Matrix operations and functions on two-dimensional arrays
- How to do it…
- Solving linear systems using matrices
- How it works…
- How to do it…
- Calculating the null space of a matrix
- How to do it…
- Calculating the LU decompositions of a matrix
- How to do it…
- Calculating the QR decomposition of a matrix
- How to do it…
- Calculating the eigenvalue and eigenvector of a matrix
- How to do it…
- Diagonalizing a matrix
- How to do it…
- Calculating the Jordan form of a matrix
- How to do it…
- Calculating the singular value decomposition of a matrix
- How to do it…
- Creating a sparse matrix
- How to do it…
- Computations on top of a sparse matrix
- How to do it…
- Chapter 6: Solving Equations and Optimization
- Introduction
- Non-linear equations and systems
- Getting ready
- How to do it...
- How it works...
- System of equations and how to solve it
- Getting ready
- How to do it...
- How it works...
- Choosing the solver used to find the solution of equations.
- Getting ready
- How to do it...
- How it works...
- Solving constrained non-linear optimization problems in several variables
- Getting ready
- How to do it...
- How it works...
- Solving one-dimensional optimization problems
- Getting ready
- How to do it...
- How it works...
- Solving multidimensional non-linear equations using the Newton-Krylov method
- Getting ready
- How to do it...
- Solving multidimensional non-linear equations using the Anderson method
- Getting ready
- How to do it...
- How it works...
- Finding the best linear fit for a set of data
- Getting ready
- How to do it...
- How it works ...
- Doing non-linear regression for a set of data
- Getting ready
- How to do it...
- How it works...
- Regression
- Getting ready
- How to do it...
- How it works...
- Chapter 7: Constants and Special Functions
- Introduction
- Physical and mathematical constants available in SciPy
- Getting ready...
- How to do it...
- Using constants in the CODATA database
- Getting ready
- How to do it...
- Bessel functions
- Getting ready...
- How to do it...
- Error functions
- Getting ready...
- How to do it...
- Orthogonal polynomials functions
- Getting ready...
- How to do it...
- Gamma function
- Getting ready...
- How to do it...
- How it works...
- The Riemann zeta function
- Getting ready
- How to do it...
- How it works...
- Airy and Bairy functions
- Getting ready...
- How to do it...
- The Bessel and Struve functions
- Getting ready...
- How to do it...
- How it works...
- There's more
- Chapter 8: Calculus, Interpolation, and Differential Equations
- Introduction
- Integration
- Getting ready
- How to do it…
- How it works...
- Computing integrals using the Newton-Cotes method
- Computing integrals using a Gaussian quadrature
- Getting ready
- How to do it.
- How it works.