MCPcopy Create free account
hub / github.com/numpy/numpy / _ensure_ndmin_ndarray_check_param

Function _ensure_ndmin_ndarray_check_param

numpy/lib/npyio.py:750–758  ·  view source on GitHub ↗

Just checks if the param ndmin is supported on _ensure_ndmin_ndarray. It is intended to be used as verification before running anything expensive. e.g. loadtxt, genfromtxt

(ndmin)

Source from the content-addressed store, hash-verified

748
749
750def _ensure_ndmin_ndarray_check_param(ndmin):
751 """Just checks if the param ndmin is supported on
752 _ensure_ndmin_ndarray. It is intended to be used as
753 verification before running anything expensive.
754 e.g. loadtxt, genfromtxt
755 """
756 # Check correctness of the values of `ndmin`
757 if ndmin not in [0, 1, 2]:
758 raise ValueError(f"Illegal value of ndmin keyword: {ndmin}")
759
760def _ensure_ndmin_ndarray(a, *, ndmin: int):
761 """This is a helper function of loadtxt and genfromtxt to ensure

Callers 2

_readFunction · 0.85
genfromtxtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected