parsers.pyi 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from typing import (
  2. Hashable,
  3. Literal,
  4. )
  5. import numpy as np
  6. from pandas._typing import (
  7. ArrayLike,
  8. Dtype,
  9. )
  10. STR_NA_VALUES: set[str]
  11. def sanitize_objects(
  12. values: np.ndarray, # ndarray[object]
  13. na_values: set,
  14. convert_empty: bool = ...,
  15. ) -> int: ...
  16. class TextReader:
  17. unnamed_cols: set[str]
  18. table_width: int # int64_t
  19. leading_cols: int # int64_t
  20. header: list[list[int]] # non-negative integers
  21. def __init__(
  22. self,
  23. source,
  24. delimiter: bytes | str = ..., # single-character only
  25. header=...,
  26. header_start: int = ..., # int64_t
  27. header_end: int = ..., # uint64_t
  28. index_col=...,
  29. names=...,
  30. tokenize_chunksize: int = ..., # int64_t
  31. delim_whitespace: bool = ...,
  32. converters=...,
  33. skipinitialspace: bool = ...,
  34. escapechar: bytes | str | None = ..., # single-character only
  35. doublequote: bool = ...,
  36. quotechar: str | bytes | None = ..., # at most 1 character
  37. quoting: int = ...,
  38. lineterminator: bytes | str | None = ..., # at most 1 character
  39. comment=...,
  40. decimal: bytes | str = ..., # single-character only
  41. thousands: bytes | str | None = ..., # single-character only
  42. dtype: Dtype | dict[Hashable, Dtype] = ...,
  43. usecols=...,
  44. error_bad_lines: bool = ...,
  45. warn_bad_lines: bool = ...,
  46. na_filter: bool = ...,
  47. na_values=...,
  48. na_fvalues=...,
  49. keep_default_na: bool = ...,
  50. true_values=...,
  51. false_values=...,
  52. allow_leading_cols: bool = ...,
  53. skiprows=...,
  54. skipfooter: int = ..., # int64_t
  55. verbose: bool = ...,
  56. mangle_dupe_cols: bool = ...,
  57. float_precision: Literal["round_trip", "legacy", "high"] | None = ...,
  58. skip_blank_lines: bool = ...,
  59. encoding_errors: bytes | str = ...,
  60. ): ...
  61. def set_error_bad_lines(self, status: int) -> None: ...
  62. def set_noconvert(self, i: int) -> None: ...
  63. def remove_noconvert(self, i: int) -> None: ...
  64. def close(self) -> None: ...
  65. def read(self, rows: int | None = ...) -> dict[int, ArrayLike]: ...
  66. def read_low_memory(self, rows: int | None) -> list[dict[int, ArrayLike]]: ...