@@ -2366,8 +2366,8 @@ def wrap(
2366
2366
def get_dummies (
2367
2367
self ,
2368
2368
sep : str = "|" ,
2369
- prefix = None ,
2370
- prefix_sep : str | Iterable [ str ] | dict [ str , str ] | None = "_" ,
2369
+ prefix : str | Iterable [ str ] | dict [ str , str ] | None = None ,
2370
+ prefix_sep : str | None = "_" ,
2371
2371
dummy_na : bool = False ,
2372
2372
sparse : bool = False ,
2373
2373
dtype : NpDtype | None = int ,
@@ -2382,6 +2382,21 @@ def get_dummies(
2382
2382
----------
2383
2383
sep : str, default "|"
2384
2384
String to split on.
2385
+ prefix : str, list of str, or dict of str, default None
2386
+ String to append DataFrame column names.
2387
+ Pass a list with length equal to the number of columns
2388
+ when calling get_dummies on a DataFrame. Alternatively, `prefix`
2389
+ can be a dictionary mapping column names to prefixes.
2390
+ prefix_sep : str, default '_'
2391
+ If appending prefix, separator/delimiter to use. Or pass a
2392
+ list or dictionary as with `prefix`.
2393
+ dummy_na : bool, default False
2394
+ Add a column to indicate NaNs, if False NaNs are ignored.
2395
+ sparse : bool, default False
2396
+ Whether the dummy-encoded columns should be backed by
2397
+ a :class:`SparseArray` (True) or a regular NumPy array (False).
2398
+ dtype : dtype, default bool
2399
+ Data type for new columns. Only a single dtype is allowed.
2385
2400
2386
2401
Returns
2387
2402
-------
0 commit comments