.. _module-structure: ************************ NumPy's module structure ************************ NumPy has a large number of submodules. Most regular usage of NumPy requires only the main namespace and a smaller set of submodules. The rest either have special-purpose or niche namespaces. Main namespaces =============== Regular/recommended user-facing namespaces for general use: .. Note: there is no single doc page that covers all of the main namespace as of now. It's hard to create without introducing duplicate references. For now, just link to the "Routines and objects by topic" page. - :ref:`numpy ` - :ref:`numpy.exceptions ` - :ref:`numpy.fft ` - :ref:`numpy.linalg ` - :ref:`numpy.polynomial ` - :ref:`numpy.random ` - :ref:`numpy.strings ` - :ref:`numpy.testing ` - :ref:`numpy.typing ` Special-purpose namespaces ========================== - :ref:`numpy.ctypeslib ` - interacting with NumPy objects with `ctypes` - :ref:`numpy.dtypes ` - dtype classes (typically not used directly by end users) - :ref:`numpy.emath ` - mathematical functions with automatic domain - :ref:`numpy.lib ` - utilities & functionality which do not fit the main namespace - :ref:`numpy.rec ` - record arrays (largely superseded by dataframe libraries) - :ref:`numpy.version ` - small module with more detailed version info Legacy namespaces ================= Prefer not to use these namespaces for new code. There are better alternatives and/or this code is deprecated or isn't reliable. - :ref:`numpy.char ` - legacy string functionality, only for fixed-width strings - :ref:`numpy.distutils ` (deprecated) - build system support - :ref:`numpy.f2py ` - Fortran binding generation (usually used from the command line only) - :ref:`numpy.ma ` - masked arrays (not very reliable, needs an overhaul) - :ref:`numpy.matlib ` (pending deprecation) - functions supporting ``matrix`` instances .. This will appear in the left sidebar on this page. Keep in sync with the contents above! .. toctree:: :hidden: numpy.exceptions numpy.fft numpy.linalg numpy.polynomial numpy.random numpy.strings numpy.testing numpy.typing numpy.ctypeslib numpy.dtypes numpy.emath numpy.lib numpy.rec numpy.version numpy.char numpy.distutils numpy.f2py <../f2py/index> numpy.ma numpy.matlib