modin.pandas.get_dummies¶
- modin.pandas.get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=None)[source]¶
Convert categorical variable into dummy/indicator variables.
- Parameters:
data (array-like, Series, or
DataFrame) – Data of which to get dummy indicators.prefix (str, list of str, or dict of str, default None) – String to append DataFrame column names. Pass a list with length equal to the number of columns when calling get_dummies on a DataFrame. Alternatively, prefix can be a dictionary mapping column names to prefixes. Only str, list of str and None is supported for this parameter.
prefix_sep (str, default '_') – If appending prefix, separator/delimiter to use.
dummy_na (bool, default False) – Add a column to indicate NaNs, if False NaNs are ignored. Only the value False is supported for this parameter.
columns (list-like, default None) – Column names in the DataFrame to be encoded. If columns is None then all the columns with string dtype will be converted.
sparse (bool, default False) – Whether the dummy-encoded columns should be backed by a
SparseArray(True) or a regular NumPy array (False). This parameter is ignored.drop_first (bool, default False) – Whether to get k-1 dummies out of k categorical levels by removing the first level. Only the value False is supported for this parameter.
dtype (dtype, default np.uint8) – Data type for new columns. Only the value None is supported for this parameter.
- Returns:
Dummy-coded data.
- Return type:
Examples