User Guide
API reference
Development
Release notes
Learn
doc/1.23
GitHub
Twitter
What is NumPy?
Installation
NumPy quickstart
NumPy: the absolute basics for beginners
NumPy fundamentals
Miscellaneous
NumPy for MATLAB users
Building from source
Using NumPy C-API
How to extend NumPy
Using Python as glue
Writing your own ufunc
Beyond the Basics
NumPy Tutorials
NumPy How Tos
For downstream package authors
F2PY user guide and reference manual
Glossary
Under-the-hood Documentation for developers
Reporting bugs
Release notes
NumPy license
Using NumPy C-API
#
How to extend NumPy
Writing an extension module
Required subroutine
Defining functions
Functions without keyword arguments
Functions with keyword arguments
Reference counting
Dealing with array objects
Converting an arbitrary sequence object
Creating a brand-new ndarray
Getting at ndarray memory and accessing elements of the ndarray
Example
Using Python as glue
Calling other compiled libraries from Python
Hand-generated wrappers
f2py
Cython
Complex addition in Cython
Image filter in Cython
Conclusion
ctypes
Having a shared library
Loading the shared library
Converting arguments
Calling the function
Complete example
Conclusion
Additional tools you may find useful
SWIG
SIP
Boost Python
PyFort
Writing your own ufunc
Creating a new universal function
Example Non-ufunc extension
Example NumPy ufunc for one dtype
Example NumPy ufunc with multiple dtypes
Example NumPy ufunc with multiple arguments/return values
Example NumPy ufunc with structured array dtype arguments
Beyond the Basics
Iterating over elements in the array
Basic Iteration
Iterating over all but one axis
Iterating over multiple arrays
Broadcasting over multiple arrays
User-defined data-types
Adding the new data-type
Registering a casting function
Registering coercion rules
Registering a ufunc loop
Subtyping the ndarray in C
Creating sub-types
Specific features of ndarray sub-typing
The __array_finalize__ method
The __array_priority__ attribute
The __array_wrap__ method
previous
Building from source
next
How to extend NumPy