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

Method __getitem__

numpy/core/records.py:281–289  ·  view source on GitHub ↗
(self, indx)

Source from the content-addressed store, hash-verified

279 "attribute '%s'" % attr)
280
281 def __getitem__(self, indx):
282 obj = nt.void.__getitem__(self, indx)
283
284 # copy behavior of record.__getattribute__,
285 if isinstance(obj, nt.void) and obj.dtype.names is not None:
286 return obj.view((self.__class__, obj.dtype))
287 else:
288 # return a single element
289 return obj
290
291 def pprint(self):
292 """Pretty-print all fields."""

Callers 1

__getitem__Method · 0.45

Calls 1

viewMethod · 0.45

Tested by

no test coverage detected