MCPcopy Index your code
hub / github.com/numpy/numpy / _ensure_ndmin_ndarray_check_param

Function _ensure_ndmin_ndarray_check_param

numpy/lib/_npyio_impl.py:793–801  ·  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

791
792
793def _ensure_ndmin_ndarray_check_param(ndmin):
794 """Just checks if the param ndmin is supported on
795 _ensure_ndmin_ndarray. It is intended to be used as
796 verification before running anything expensive.
797 e.g. loadtxt, genfromtxt
798 """
799 # Check correctness of the values of `ndmin`
800 if ndmin not in [0, 1, 2]:
801 raise ValueError(f"Illegal value of ndmin keyword: {ndmin}")
802
803def _ensure_ndmin_ndarray(a, *, ndmin: int):
804 """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

Used in the wild real call sites across dependent graphs

searching dependent graphs…