SciPy Cookbook¶
This is the “SciPy Cookbook” — a collection of various user-contributed
recipes, which once lived under wiki.scipy.org
.
If you have a nice notebook you’d like to add here, or you’d like to make
some other edits, please see the SciPy-CookBook repository.
Input & Output¶
Data Acquisition with NIDAQmx Data acquisition with PyUL Fortran I/O Formats Input and output LAS reader Reading SPE file from CCD camera Reading mat files hdf5 in Matlab
Interfacing With Other Languages¶
C Extensions for Using NumPy Arrays C extensions Ctypes F2py Inline Weave With Basic Array Conversion (no Blitz) SWIG Numpy examples SWIG and Numpy SWIG memory deallocation f2py and numpy
Linear Algebra¶
Matplotlib / 3D Plotting¶
Matplotlib / Embedding Plots in Apps¶
Embedding In Wx Embedding in Traits GUI Matplotlib: drag’n’drop text example Matplotlib: pyside Matplotlib: scrolling plot
Matplotlib / Misc¶
Load image Matplotlib: adjusting image size Matplotlib: compiling matplotlib on solaris10 Matplotlib: deleting an existing data series Matplotlib: django Matplotlib: interactive plotting Matplotlib: matplotlib and zope Matplotlib: multiple subplots with one axis label Matplotlib: qt with ipython and designer Matplotlib: using matplotlib in a CGI script
Matplotlib / Pseudo Color Plots¶
Matplotlib: colormap transformations Matplotlib: converting a matrix to a raster image Matplotlib: gridding irregularly spaced data Matplotlib: loading a colormap dynamically Matplotlib: plotting images with special values Matplotlib: show colormaps
Matplotlib / Simple Plotting¶
Histograms Matplotlib: animations Matplotlib: arrows Matplotlib: bar charts Matplotlib: custom log labels Matplotlib: hint on diagrams Matplotlib: legend Matplotlib: maps Matplotlib: multicolored line Matplotlib: multiline plots Matplotlib: plotting values with masked arrays Matplotlib: shaded regions Matplotlib: sigmoidal functions Matplotlib: thick axes Matplotlib: transformations Matplotlib: treemap Matplotlib: unfilled histograms
Matplotlib / Typesetting¶
Mayavi¶
Mayabi: mlab Mayavi Mayavi surf Mayavi tips Mayavi tvtk Mayavi: examples Mayavi: running mayavi 2 Scripting Mayavi 2 Scripting Mayavi 2: basic modules Scripting Mayavi 2: filters Scripting Mayavi 2: main modules
Numpy¶
Addressing Array Columns by Name Building arrays Convolution-like operations Indexing numpy arrays MetaArray Multidot Object arrays using record arrays Stride tricks for the Game of Life Views versus copies in NumPy accumarray like function
Optimization and fitting¶
Fitting data Kwargs optimization wrapper Large-scale bundle adjustment in scipy Least squares circle Linear regression OLS Optimization and fit demo Optimization demo RANSAC Robust nonlinear regression in scipy
Ordinary differential equations¶
Coupled spring-mass system Korteweg de Vries equation Matplotlib: lotka volterra tutorial Modeling a Zombie Apocalypse Solving a discrete boundary-value problem in scipy Theoretical ecology: Hastings and Powell
Other examples¶
Brownian Motion Correlated Random Samples Easy multithreading Eye Diagram Finding the Convex Hull of a 2-D Dataset Finding the minimum point in the convex hull of a finite set of points KDTree example Line Integral Convolution Linear classification Particle filter Reading custom text files with Pyparsing Rebinning Solving large Markov Chains Watershed
Performance¶
A beginners guide to using Python for performance computing Parallel Programming with numpy and scipy