DOC: linalg: incorrect comparison to `np.linalg`
Author: bwolleswinkelCreated Jan 5, 2026Updated Sep 16, 2026
Labelsscipy.linalgDocumentationsustain-2026
Issue with current documentation:
The documentation of scipy states that (doc):
scipy.linalgcontains all the functions innumpy.linalg.plus some other more advanced ones not contained innumpy.linalg.
However, several (commonly used) functionalities from numpy.linalg are, unfortunately, not available in scipy.linalg, including (but not limited to) numpy.linalg.matrix_rank(...) and numpy.linalg.matrix_power(...), which are used abundantly. This is misleading to users, who would expect the above to be available based on the mentioned documentation, tempting them to rely solely on scipy.linalg (which, as of now, is unfortunately not possible).
Idea or request for content:
I myself see two solutions:
- Update the documentation to make it explicit that
scipy.linalgcannot be used as a one-on-one replacement fornumpy.linalg, as not all functionalities are provided equally. - (Preferred) Add the functionalities provided by
numpy.linalgtoscipy.linalg. I do not know how hard it is to implement/wrap all of the providednumpy.linalgfunctionality, but it would be amazing in streamlining code to be able to rely solely onimport scipy.linalg as lainstead of having to (arbitrarily) switch from SciPy to NumPy.
Additional context (e.g. screenshots, GIFs)
Source: scipy/scipy