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

Method __int__

numpy/ma/core.py:4459–4469  ·  view source on GitHub ↗

Convert to int.

(self)

Source from the content-addressed store, hash-verified

4457 return float(self.item())
4458
4459 def __int__(self):
4460 """
4461 Convert to int.
4462
4463 """
4464 if self.size > 1:
4465 raise TypeError("Only length-1 arrays can be converted "
4466 "to Python scalars")
4467 elif self._mask:
4468 raise MaskError('Cannot convert masked element to a Python int.')
4469 return int(self.item())
4470
4471 @property
4472 def imag(self):

Callers

nothing calls this directly

Calls 2

MaskErrorClass · 0.85
itemMethod · 0.80

Tested by

no test coverage detected