pandas.get_dummies — pandas 0.24.0rc1 documentation (original) (raw)
data : array-like, Series, or DataFrame
prefix : string, list of strings, or dict of strings, 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, prefixcan be a dictionary mapping column names to prefixes.
prefix_sep : string, default ‘_’
If appending prefix, separator/delimiter to use. Or pass a list or dictionary as with prefix.
dummy_na : bool, default False
Add a column to indicate NaNs, if False NaNs are ignored.
columns : list-like, default None
Column names in the DataFrame to be encoded. If columns is None then all the columns withobject or category dtype will be converted.
sparse : bool, default False
Whether the dummy-encoded columns should be be backed by a SparseArray (True) or a regular NumPy array (False).
drop_first : bool, default False
Whether to get k-1 dummies out of k categorical levels by removing the first level.
New in version 0.18.0.
dtype : dtype, default np.uint8
Data type for new columns. Only a single dtype is allowed.
New in version 0.23.0.