mrecords.pyi 1.9 KB

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