Navigation
next
previous
|
Scipy lecture notes
»
Collapse document to compact view
2. Advanced topics
ΒΆ
2.1. Advanced Python Constructs
2.1.1. Iterators, generator expressions and generators
2.1.1.1. Iterators
2.1.1.2. Generator expressions
2.1.1.3. Generators
2.1.1.4. Bidirectional communication
2.1.1.5. Chaining generators
2.1.2. Decorators
2.1.2.1. Replacing or tweaking the original object
2.1.2.2. Decorators implemented as classes and as functions
2.1.2.3. Copying the docstring and other attributes of the original function
2.1.2.4. Examples in the standard library
2.1.2.5. Deprecation of functions
2.1.2.6. A
while
-loop removing decorator
2.1.2.7. A plugin registration system
2.1.2.8. More examples and reading
2.1.3. Context managers
2.1.3.1. Catching exceptions
2.1.3.2. Using generators to define context managers
2.2. Advanced Numpy
2.2.1. Life of ndarray
2.2.1.1. It’s...
2.2.1.2. Block of memory
2.2.1.3. Data types
2.2.1.4. Indexing scheme: strides
2.2.1.5. Findings in dissection
2.2.2. Universal functions
2.2.2.1. What they are?
2.2.2.2. Exercise: building an ufunc from scratch
2.2.2.3. Solution: building an ufunc from scratch
2.2.2.4. Generalized ufuncs
2.2.3. Interoperability features
2.2.3.1. Sharing multidimensional, typed data
2.2.3.2. The old buffer protocol
2.2.3.3. The old buffer protocol
2.2.3.4. Array interface protocol
2.2.4. Array siblings:
chararray
,
maskedarray
,
matrix
2.2.4.1.
chararray
: vectorized string operations
2.2.4.2.
masked_array
missing data
2.2.4.3.
recarray
: purely convenience
2.2.4.4.
matrix
: convenience?
2.2.5. Summary
2.2.6. Contributing to Numpy/Scipy
2.2.6.1. Why
2.2.6.2. Reporting bugs
2.2.6.3. Contributing to documentation
2.2.6.4. Contributing features
2.2.6.5. How to help, in general
2.3. Debugging code
2.3.1. Avoiding bugs
2.3.1.1. Coding best practices to avoid getting in trouble
2.3.1.2. pyflakes: fast static analysis
2.3.2. Debugging workflow
2.3.3. Using the Python debugger
2.3.3.1. Invoking the debugger
2.3.3.2. Debugger commands and interaction
2.3.4. Debugging segmentation faults using gdb
2.4. Optimizing code
2.4.1. Optimization workflow
2.4.2. Profiling Python code
2.4.2.1. Timeit
2.4.2.2. Profiler
2.4.2.3. Line-profiler
2.4.2.4. Running
cProfile
2.4.2.5. Using
gprof2dot
2.4.3. Making code go faster
2.4.3.1. Algorithmic optimization
2.4.4. Writing faster numerical code
2.4.4.1. Additional Links
2.5. Sparse Matrices in SciPy
2.5.1. Introduction
2.5.1.1. Why Sparse Matrices?
2.5.1.2. Sparse Matrices vs. Sparse Matrix Storage Schemes
2.5.1.3. Typical Applications
2.5.1.4. Prerequisites
2.5.1.5. Sparsity Structure Visualization
2.5.2. Storage Schemes
2.5.2.1. Common Methods
2.5.2.2. Sparse Matrix Classes
2.5.2.3. Summary
2.5.3. Linear System Solvers
2.5.3.1. Sparse Direct Solvers
2.5.3.2. Iterative Solvers
2.5.3.3. Eigenvalue Problem Solvers
2.5.4. Other Interesting Packages
2.6. Image manipulation and processing using Numpy and Scipy
2.6.1. Opening and writing to image files
2.6.2. Displaying images
2.6.3. Basic manipulations
2.6.3.1. Statistical information
2.6.3.2. Geometrical transformations
2.6.4. Image filtering
2.6.4.1. Blurring/smoothing
2.6.4.2. Sharpening
2.6.4.3. Denoising
2.6.4.4. Mathematical morphology
2.6.5. Feature extraction
2.6.5.1. Edge detection
2.6.5.2. Segmentation
2.6.6. Measuring objects properties:
ndimage.measurements
2.7. Mathematical optimization: finding minima of functions
2.7.1. Knowing your problem
2.7.1.1. Convex versus non-convex optimization
2.7.1.2. Smooth and non-smooth problems
2.7.1.3. Noisy versus exact cost functions
2.7.1.4. Constraints
2.7.2. A review of the different optimizers
2.7.2.1. Getting started: 1D optimization
2.7.2.2. Gradient based methods
2.7.2.3. Newton and quasi-newton methods
2.7.2.4. Gradient-less methods
2.7.2.5. Global optimizers
2.7.3. Practical guide to optimization with scipy
2.7.3.1. Choosing a method
2.7.3.2. Making your optimizer faster
2.7.3.3. Computing gradients
2.7.3.4. Synthetic exercices
2.7.4. Special case: non-linear least-squares
2.7.4.1. Minimizing the norm of a vector function
2.7.4.2. Curve fitting
2.7.5. Optimization with constraints
2.7.5.1. Box bounds
2.7.5.2. General constraints
2.8. Traits
2.8.1. Introduction
2.8.2. Example
2.8.3. What are Traits
2.8.3.1. Initialisation
2.8.3.2. Validation
2.8.3.3. Documentation
2.8.3.4. Visualisation
2.8.3.5. Deferral
2.8.3.6. Notification
2.8.3.7. Some more advanced traits
2.8.4. References
2.9. 3D plotting with Mayavi
2.9.1. Mlab: the scripting interface
2.9.1.1. 3D plotting functions
2.9.1.2. Figures and decorations
2.9.2. Interactive work
2.9.2.1. The “pipeline dialog”
2.9.2.2. The script recording button
2.10. Sympy : Symbolic Mathematics in Python
2.10.1. First Steps with SymPy
2.10.1.1. Using SymPy as a calculator
2.10.1.2. Exercises
2.10.1.3. Symbols
2.10.2. Algebraic manipulations
2.10.2.1. Expand
2.10.2.2. Simplify
2.10.2.3. Exercises
2.10.3. Calculus
2.10.3.1. Limits
2.10.3.2. Differentiation
2.10.3.3. Series expansion
2.10.3.4. Exercises
2.10.3.5. Integration
2.10.3.6. Exercises
2.10.4. Equation solving
2.10.4.1. Exercises
2.10.5. Linear Algebra
2.10.5.1. Matrices
2.10.5.2. Differential Equations
2.10.5.3. Exercises
2.11. scikit-learn: machine learning in Python
2.11.1. Loading an example dataset
2.11.1.1. Learning and Predicting
2.11.2. Classification
2.11.2.1. k-Nearest neighbors classifier
2.11.2.2. Support vector machines (SVMs) for classification
2.11.3. Clustering: grouping observations together
2.11.3.1. K-means clustering
2.11.4. Dimension Reduction with Principal Component Analysis
2.11.5. Putting it all together: face recognition
2.11.6. Linear model: from regression to sparsity
2.11.6.1. Sparse models
2.11.7. Model selection: choosing estimators and their parameters
2.11.7.1. Grid-search and cross-validated estimators
2.12. Interfacing with C
2.12.1. Introduction
2.12.2. Python-C-Api
2.12.2.1. Example
2.12.2.2. Numpy Support
2.12.3. Ctypes
2.12.3.1. Example
2.12.3.2. Numpy Support
2.12.4. SWIG
2.12.4.1. Example
2.12.4.2. Numpy Support
2.12.5. Cython
2.12.5.1. Example
2.12.5.2. Numpy Support
2.12.6. Summary
2.12.7. Further Reading and References
2.12.8. Exercises
2.12.8.1. Python-C-API
2.12.8.2. Ctypes
2.12.8.3. SWIG
2.12.8.4. Cython
Navigation
next
previous
|
Scipy lecture notes
»
Collapse document to compact view