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

Method _find_map_entry

numpy/lib/_iotools.py:584–595  ·  view source on GitHub ↗
(cls, dtype)

Source from the content-addressed store, hash-verified

582
583 @classmethod
584 def _find_map_entry(cls, dtype):
585 # if a converter for the specific dtype is available use that
586 for i, (deftype, func, default_def) in enumerate(cls._mapper):
587 if dtype.type == deftype:
588 return i, (deftype, func, default_def)
589
590 # otherwise find an inexact match
591 for i, (deftype, func, default_def) in enumerate(cls._mapper):
592 if np.issubdtype(dtype.type, deftype):
593 return i, (deftype, func, default_def)
594
595 raise LookupError
596
597 def __init__(self, dtype_or_func=None, default=None, missing_values=None,
598 locked=False):

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected