/ lib / numpy / ma / mrecords.pyi
mrecords.pyi
 1  from typing import Any, TypeVar
 2  
 3  from numpy import dtype
 4  from numpy.ma import MaskedArray
 5  
 6  __all__: list[str]
 7  
 8  # TODO: Set the `bound` to something more suitable once we
 9  # have proper shape support
10  _ShapeType = TypeVar("_ShapeType", bound=Any)
11  _DType_co = TypeVar("_DType_co", bound=dtype[Any], covariant=True)
12  
13  class MaskedRecords(MaskedArray[_ShapeType, _DType_co]):
14      def __new__(
15          cls,
16          shape,
17          dtype=...,
18          buf=...,
19          offset=...,
20          strides=...,
21          formats=...,
22          names=...,
23          titles=...,
24          byteorder=...,
25          aligned=...,
26          mask=...,
27          hard_mask=...,
28          fill_value=...,
29          keep_mask=...,
30          copy=...,
31          **options,
32      ): ...
33      _mask: Any
34      _fill_value: Any
35      @property
36      def _data(self): ...
37      @property
38      def _fieldmask(self): ...
39      def __array_finalize__(self, obj): ...
40      def __len__(self): ...
41      def __getattribute__(self, attr): ...
42      def __setattr__(self, attr, val): ...
43      def __getitem__(self, indx): ...
44      def __setitem__(self, indx, value): ...
45      def view(self, dtype=..., type=...): ...
46      def harden_mask(self): ...
47      def soften_mask(self): ...
48      def copy(self): ...
49      def tolist(self, fill_value=...): ...
50      def __reduce__(self): ...
51  
52  mrecarray = MaskedRecords
53  
54  def fromarrays(
55      arraylist,
56      dtype=...,
57      shape=...,
58      formats=...,
59      names=...,
60      titles=...,
61      aligned=...,
62      byteorder=...,
63      fill_value=...,
64  ): ...
65  
66  def fromrecords(
67      reclist,
68      dtype=...,
69      shape=...,
70      formats=...,
71      names=...,
72      titles=...,
73      aligned=...,
74      byteorder=...,
75      fill_value=...,
76      mask=...,
77  ): ...
78  
79  def fromtextfile(
80      fname,
81      delimiter=...,
82      commentchar=...,
83      missingchar=...,
84      varnames=...,
85      vartypes=...,
86      # NOTE: deprecated: NumPy 1.22.0, 2021-09-23
87      # delimitor=...,
88  ): ...
89  
90  def addfield(mrecord, newfield, newfieldname=...): ...