|
77 | 77 | DtypeArg, |
78 | 78 | DtypeBackend, |
79 | 79 | FilePath, |
80 | | - HashableT, |
81 | 80 | IndexLabel, |
82 | 81 | ReadCsvBuffer, |
83 | 82 | Self, |
84 | 83 | StorageOptions, |
| 84 | + UsecolsArgType, |
85 | 85 | ) |
86 | 86 | _doc_read_csv_and_table = ( |
87 | 87 | r""" |
|
142 | 142 | Note: ``index_col=False`` can be used to force pandas to *not* use the first |
143 | 143 | column as the index, e.g., when you have a malformed file with delimiters at |
144 | 144 | the end of each line. |
145 | | -usecols : list of Hashable or Callable, optional |
| 145 | +usecols : Sequence of Hashable or Callable, optional |
146 | 146 | Subset of columns to select, denoted either by column labels or column indices. |
147 | 147 | If list-like, all elements must either |
148 | 148 | be positional (i.e. integer indices into the document columns) or strings |
@@ -645,10 +645,7 @@ def read_csv( |
645 | 645 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
646 | 646 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
647 | 647 | index_col: IndexLabel | Literal[False] | None = ..., |
648 | | - usecols: list[HashableT] |
649 | | - | tuple[HashableT] |
650 | | - | Callable[[Hashable], bool] |
651 | | - | None = ..., |
| 648 | + usecols: UsecolsArgType = ..., |
652 | 649 | dtype: DtypeArg | None = ..., |
653 | 650 | engine: CSVEngine | None = ..., |
654 | 651 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -707,10 +704,7 @@ def read_csv( |
707 | 704 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
708 | 705 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
709 | 706 | index_col: IndexLabel | Literal[False] | None = ..., |
710 | | - usecols: list[HashableT] |
711 | | - | tuple[HashableT] |
712 | | - | Callable[[Hashable], bool] |
713 | | - | None = ..., |
| 707 | + usecols: UsecolsArgType = ..., |
714 | 708 | dtype: DtypeArg | None = ..., |
715 | 709 | engine: CSVEngine | None = ..., |
716 | 710 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -770,10 +764,7 @@ def read_csv( |
770 | 764 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
771 | 765 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
772 | 766 | index_col: IndexLabel | Literal[False] | None = ..., |
773 | | - usecols: list[HashableT] |
774 | | - | tuple[HashableT] |
775 | | - | Callable[[Hashable], bool] |
776 | | - | None = ..., |
| 767 | + usecols: UsecolsArgType = ..., |
777 | 768 | dtype: DtypeArg | None = ..., |
778 | 769 | engine: CSVEngine | None = ..., |
779 | 770 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -833,10 +824,7 @@ def read_csv( |
833 | 824 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
834 | 825 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
835 | 826 | index_col: IndexLabel | Literal[False] | None = ..., |
836 | | - usecols: list[HashableT] |
837 | | - | tuple[HashableT] |
838 | | - | Callable[[Hashable], bool] |
839 | | - | None = ..., |
| 827 | + usecols: UsecolsArgType = ..., |
840 | 828 | dtype: DtypeArg | None = ..., |
841 | 829 | engine: CSVEngine | None = ..., |
842 | 830 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -907,10 +895,7 @@ def read_csv( |
907 | 895 | header: int | Sequence[int] | None | Literal["infer"] = "infer", |
908 | 896 | names: Sequence[Hashable] | None | lib.NoDefault = lib.no_default, |
909 | 897 | index_col: IndexLabel | Literal[False] | None = None, |
910 | | - usecols: list[HashableT] |
911 | | - | tuple[HashableT] |
912 | | - | Callable[[Hashable], bool] |
913 | | - | None = None, |
| 898 | + usecols: UsecolsArgType = None, |
914 | 899 | # General Parsing Configuration |
915 | 900 | dtype: DtypeArg | None = None, |
916 | 901 | engine: CSVEngine | None = None, |
@@ -1005,10 +990,7 @@ def read_table( |
1005 | 990 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
1006 | 991 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
1007 | 992 | index_col: IndexLabel | Literal[False] | None = ..., |
1008 | | - usecols: list[HashableT] |
1009 | | - | tuple[HashableT] |
1010 | | - | Callable[[Hashable], bool] |
1011 | | - | None = ..., |
| 993 | + usecols: UsecolsArgType = ..., |
1012 | 994 | dtype: DtypeArg | None = ..., |
1013 | 995 | engine: CSVEngine | None = ..., |
1014 | 996 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -1065,10 +1047,7 @@ def read_table( |
1065 | 1047 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
1066 | 1048 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
1067 | 1049 | index_col: IndexLabel | Literal[False] | None = ..., |
1068 | | - usecols: list[HashableT] |
1069 | | - | tuple[HashableT] |
1070 | | - | Callable[[Hashable], bool] |
1071 | | - | None = ..., |
| 1050 | + usecols: UsecolsArgType = ..., |
1072 | 1051 | dtype: DtypeArg | None = ..., |
1073 | 1052 | engine: CSVEngine | None = ..., |
1074 | 1053 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -1125,10 +1104,7 @@ def read_table( |
1125 | 1104 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
1126 | 1105 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
1127 | 1106 | index_col: IndexLabel | Literal[False] | None = ..., |
1128 | | - usecols: list[HashableT] |
1129 | | - | tuple[HashableT] |
1130 | | - | Callable[[Hashable], bool] |
1131 | | - | None = ..., |
| 1107 | + usecols: UsecolsArgType = ..., |
1132 | 1108 | dtype: DtypeArg | None = ..., |
1133 | 1109 | engine: CSVEngine | None = ..., |
1134 | 1110 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -1185,10 +1161,7 @@ def read_table( |
1185 | 1161 | header: int | Sequence[int] | None | Literal["infer"] = ..., |
1186 | 1162 | names: Sequence[Hashable] | None | lib.NoDefault = ..., |
1187 | 1163 | index_col: IndexLabel | Literal[False] | None = ..., |
1188 | | - usecols: list[HashableT] |
1189 | | - | tuple[HashableT] |
1190 | | - | Callable[[Hashable], bool] |
1191 | | - | None = ..., |
| 1164 | + usecols: UsecolsArgType = ..., |
1192 | 1165 | dtype: DtypeArg | None = ..., |
1193 | 1166 | engine: CSVEngine | None = ..., |
1194 | 1167 | converters: Mapping[Hashable, Callable] | None = ..., |
@@ -1258,10 +1231,7 @@ def read_table( |
1258 | 1231 | header: int | Sequence[int] | None | Literal["infer"] = "infer", |
1259 | 1232 | names: Sequence[Hashable] | None | lib.NoDefault = lib.no_default, |
1260 | 1233 | index_col: IndexLabel | Literal[False] | None = None, |
1261 | | - usecols: list[HashableT] |
1262 | | - | tuple[HashableT] |
1263 | | - | Callable[[Hashable], bool] |
1264 | | - | None = None, |
| 1234 | + usecols: UsecolsArgType = None, |
1265 | 1235 | # General Parsing Configuration |
1266 | 1236 | dtype: DtypeArg | None = None, |
1267 | 1237 | engine: CSVEngine | None = None, |
|
0 commit comments