@@ -64,13 +64,13 @@ def shape(self) -> tuple[int, int]:
64
64
Return number of rows and number of columns.
65
65
"""
66
66
67
- def group_by (self , keys : str | list [ str ], / ) -> GroupBy :
67
+ def group_by (self , * keys : str ) -> GroupBy :
68
68
"""
69
69
Group the DataFrame by the given columns.
70
70
71
71
Parameters
72
72
----------
73
- keys : str | list[str]
73
+ * keys : str
74
74
75
75
Returns
76
76
-------
@@ -179,7 +179,7 @@ def filter(self, mask: Column) -> DataFrame:
179
179
"""
180
180
...
181
181
182
- def assign (self , columns : Column | Sequence [ Column ], / ) -> DataFrame :
182
+ def assign (self , * columns : Column ) -> DataFrame :
183
183
"""
184
184
Insert new column(s), or update values in existing ones.
185
185
@@ -197,7 +197,7 @@ def assign(self, columns: Column | Sequence[Column], /) -> DataFrame:
197
197
198
198
Parameters
199
199
----------
200
- columns : Column | Sequence[Column]
200
+ * columns : Column
201
201
Column(s) to update/insert. If updating/inserting multiple columns,
202
202
they must all have different names.
203
203
@@ -207,13 +207,13 @@ def assign(self, columns: Column | Sequence[Column], /) -> DataFrame:
207
207
"""
208
208
...
209
209
210
- def drop_columns (self , label : str | list [ str ] ) -> DataFrame :
210
+ def drop_columns (self , * labels : str ) -> DataFrame :
211
211
"""
212
212
Drop the specified column(s).
213
213
214
214
Parameters
215
215
----------
216
- label : str | list[str]
216
+ * label : str
217
217
Column name(s) to drop.
218
218
219
219
Returns
@@ -266,8 +266,7 @@ def schema(self) -> dict[str, Any]:
266
266
267
267
def sort (
268
268
self ,
269
- keys : str | list [str ] | None = None ,
270
- * ,
269
+ * keys : str ,
271
270
ascending : Sequence [bool ] | bool = True ,
272
271
nulls_position : Literal ['first' , 'last' ] = 'last' ,
273
272
) -> DataFrame :
@@ -279,9 +278,9 @@ def sort(
279
278
280
279
Parameters
281
280
----------
282
- keys : str | list[str], optional
281
+ * keys : str
283
282
Names of columns to sort by.
284
- If `None` , sort by all columns.
283
+ If not specified , sort by all columns.
285
284
ascending : Sequence[bool] or bool
286
285
If `True`, sort by all keys in ascending order.
287
286
If `False`, sort by all keys in descending order.
@@ -307,8 +306,7 @@ def sort(
307
306
308
307
def sorted_indices (
309
308
self ,
310
- keys : str | list [str ] | None = None ,
311
- * ,
309
+ * keys : str ,
312
310
ascending : Sequence [bool ] | bool = True ,
313
311
nulls_position : Literal ['first' , 'last' ] = 'last' ,
314
312
) -> Column :
@@ -319,9 +317,9 @@ def sorted_indices(
319
317
320
318
Parameters
321
319
----------
322
- keys : str | list[str], optional
320
+ * keys : str
323
321
Names of columns to sort by.
324
- If `None` , sort by all columns.
322
+ If not specified , sort by all columns.
325
323
ascending : Sequence[bool] or bool
326
324
If `True`, sort by all keys in ascending order.
327
325
If `False`, sort by all keys in descending order.
@@ -815,15 +813,15 @@ def is_nan(self) -> DataFrame:
815
813
"""
816
814
...
817
815
818
- def unique_indices (self , keys : str | list [ str ] | None = None , * , skip_nulls : bool = True ) -> Column :
816
+ def unique_indices (self , * keys : str , skip_nulls : bool = True ) -> Column :
819
817
"""
820
818
Return indices corresponding to unique values across selected columns.
821
819
822
820
Parameters
823
821
----------
824
- keys : str | list[str], optional
822
+ * keys : str
825
823
Column names to consider when finding unique values.
826
- If `None` , all columns are considered.
824
+ If not specified , all columns are considered.
827
825
828
826
Returns
829
827
-------
0 commit comments