mrecords.pyi 1.9 KB

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