def get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=np.uint8, **kwargs):
    "\n    Convert categorical variable into dummy/indicator variables.\n\n    Data must have category dtype to infer result's ``columns``.\n\n    Parameters\n    ----------\n    data : Series, or DataFrame\n        For Series, the dtype must be categorical.\n        For DataFrame, at least one column must be categorical.\n    prefix : string, list of strings, or dict of strings, default None\n        String to append DataFrame column names.\n        Pass a list with length equal to the number of columns\n        when calling get_dummies on a DataFrame. Alternatively, `prefix`\n        can be a dictionary mapping column names to prefixes.\n    prefix_sep : string, default '_'\n        If appending prefix, separator/delimiter to use. Or pass a\n        list or dictionary as with `prefix.`\n    dummy_na : bool, default False\n        Add a column to indicate NaNs, if False NaNs are ignored.\n    columns : list-like, default None\n        Column names in the DataFrame to be encoded.\n        If `columns` is None then all the columns with\n        `category` dtype will be converted.\n    sparse : bool, default False\n        Whether the dummy columns should be sparse or not.  Returns\n        SparseDataFrame if `data` is a Series or if all columns are included.\n        Otherwise returns a DataFrame with some SparseBlocks.\n\n        .. versionadded:: 0.18.2\n\n    drop_first : bool, default False\n        Whether to get k-1 dummies out of k categorical levels by removing the\n        first level.\n\n    dtype : dtype, default np.uint8\n        Data type for new columns. Only a single dtype is allowed.\n\n        .. versionadded:: 0.18.2\n\n    Returns\n    -------\n    dummies : DataFrame\n\n    Examples\n    --------\n    Dask's version only works with Categorical data, as this is the only way to\n    know the output shape without computing all the data.\n\n    >>> import pandas as pd\n    >>> import dask.dataframe as dd\n    >>> s = dd.from_pandas(pd.Series(list('abca')), npartitions=2)\n    >>> dd.get_dummies(s)\n    Traceback (most recent call last):\n        ...\n    NotImplementedError: `get_dummies` with non-categorical dtypes is not supported...\n\n    With categorical data:\n\n    >>> s = dd.from_pandas(pd.Series(list('abca'), dtype='category'), npartitions=2)\n    >>> dd.get_dummies(s)  # doctest: +NORMALIZE_WHITESPACE\n    Dask DataFrame Structure:\n                       a      b      c\n    npartitions=2\n    0              uint8  uint8  uint8\n    2                ...    ...    ...\n    3                ...    ...    ...\n    Dask Name: get_dummies, 4 tasks\n    >>> dd.get_dummies(s).compute()  # doctest: +ELLIPSIS\n       a  b  c\n    0  1  0  0\n    1  0  1  0\n    2  0  0  1\n    3  1  0  0\n\n    See Also\n    --------\n    pandas.get_dummies\n    "
    if isinstance(data, (pd.Series, pd.DataFrame)):
        return pd.get_dummies(data, prefix=prefix, prefix_sep=prefix_sep, dummy_na=dummy_na, columns=columns, sparse=sparse, drop_first=drop_first, dtype=dtype, **kwargs)
    not_cat_msg = '`get_dummies` with non-categorical dtypes is not supported. Please use `df.categorize()` beforehand to convert to categorical dtype.'
    unknown_cat_msg = '`get_dummies` with unknown categories is not supported. Please use `column.cat.as_known()` or `df.categorize()` beforehand to ensure known categories'
    if isinstance(data, Series):
        if (not methods.is_categorical_dtype(data)):
            raise NotImplementedError(not_cat_msg)
        if (not has_known_categories(data)):
            raise NotImplementedError(unknown_cat_msg)
    elif isinstance(data, DataFrame):
        if (columns is None):
            if (data.dtypes == 'object').any():
                raise NotImplementedError(not_cat_msg)
            columns = data._meta.select_dtypes(include=['category']).columns
        elif (not all((methods.is_categorical_dtype(data[c]) for c in columns))):
            raise NotImplementedError(not_cat_msg)
        if (not all((has_known_categories(data[c]) for c in columns))):
            raise NotImplementedError(unknown_cat_msg)
    package_name = data._meta.__class__.__module__.split('.')[0]
    dummies = sys.modules[package_name].get_dummies
    return map_partitions(dummies, data, prefix=prefix, prefix_sep=prefix_sep, dummy_na=dummy_na, columns=columns, sparse=sparse, drop_first=drop_first, dtype=dtype, **kwargs)
Convert categorical variable into dummy/indicator variables.

Data must have category dtype to infer result's ``columns``.

Parameters
----------
data : Series, or DataFrame
    For Series, the dtype must be categorical.
    For DataFrame, at least one column must be categorical.
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, `prefix`
    can 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 with
    `category` dtype will be converted.
sparse : bool, default False
    Whether the dummy columns should be sparse or not.  Returns
    SparseDataFrame if `data` is a Series or if all columns are included.
    Otherwise returns a DataFrame with some SparseBlocks.

    .. versionadded:: 0.18.2

drop_first : bool, default False
    Whether to get k-1 dummies out of k categorical levels by removing the
    first level.

dtype : dtype, default np.uint8
    Data type for new columns. Only a single dtype is allowed.

    .. versionadded:: 0.18.2

Returns
-------
dummies : DataFrame

Examples
--------
Dask's version only works with Categorical data, as this is the only way to
know the output shape without computing all the data.

>>> import pandas as pd
>>> import dask.dataframe as dd
>>> s = dd.from_pandas(pd.Series(list('abca')), npartitions=2)
>>> dd.get_dummies(s)
Traceback (most recent call last):
    ...
NotImplementedError: `get_dummies` with non-categorical dtypes is not supported...

With categorical data:

>>> s = dd.from_pandas(pd.Series(list('abca'), dtype='category'), npartitions=2)
>>> dd.get_dummies(s)  # doctest: +NORMALIZE_WHITESPACE
Dask DataFrame Structure:
                   a      b      c
npartitions=2
0              uint8  uint8  uint8
2                ...    ...    ...
3                ...    ...    ...
Dask Name: get_dummies, 4 tasks
>>> dd.get_dummies(s).compute()  # doctest: +ELLIPSIS
   a  b  c
0  1  0  0
1  0  1  0
2  0  0  1
3  1  0  0

See Also
--------
pandas.get_dummies
def get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=np.uint8, **kwargs):
    "\n    Convert categorical variable into dummy/indicator variables.\n\n    Data must have category dtype to infer result's ``columns``.\n\n    Parameters\n    ----------\n    data : Series, or DataFrame\n        For Series, the dtype must be categorical.\n        For DataFrame, at least one column must be categorical.\n    prefix : string, list of strings, or dict of strings, default None\n        String to append DataFrame column names.\n        Pass a list with length equal to the number of columns\n        when calling get_dummies on a DataFrame. Alternatively, `prefix`\n        can be a dictionary mapping column names to prefixes.\n    prefix_sep : string, default '_'\n        If appending prefix, separator/delimiter to use. Or pass a\n        list or dictionary as with `prefix.`\n    dummy_na : bool, default False\n        Add a column to indicate NaNs, if False NaNs are ignored.\n    columns : list-like, default None\n        Column names in the DataFrame to be encoded.\n        If `columns` is None then all the columns with\n        `category` dtype will be converted.\n    sparse : bool, default False\n        Whether the dummy columns should be sparse or not.  Returns\n        SparseDataFrame if `data` is a Series or if all columns are included.\n        Otherwise returns a DataFrame with some SparseBlocks.\n\n        .. versionadded:: 0.18.2\n\n    drop_first : bool, default False\n        Whether to get k-1 dummies out of k categorical levels by removing the\n        first level.\n\n    dtype : dtype, default np.uint8\n        Data type for new columns. Only a single dtype is allowed.\n\n        .. versionadded:: 0.18.2\n\n    Returns\n    -------\n    dummies : DataFrame\n\n    Examples\n    --------\n    Dask's version only works with Categorical data, as this is the only way to\n    know the output shape without computing all the data.\n\n    >>> import pandas as pd\n    >>> import dask.dataframe as dd\n    >>> s = dd.from_pandas(pd.Series(list('abca')), npartitions=2)\n    >>> dd.get_dummies(s)\n    Traceback (most recent call last):\n        ...\n    NotImplementedError: `get_dummies` with non-categorical dtypes is not supported...\n\n    With categorical data:\n\n    >>> s = dd.from_pandas(pd.Series(list('abca'), dtype='category'), npartitions=2)\n    >>> dd.get_dummies(s)  # doctest: +NORMALIZE_WHITESPACE\n    Dask DataFrame Structure:\n                       a      b      c\n    npartitions=2\n    0              uint8  uint8  uint8\n    2                ...    ...    ...\n    3                ...    ...    ...\n    Dask Name: get_dummies, 4 tasks\n    >>> dd.get_dummies(s).compute()  # doctest: +ELLIPSIS\n       a  b  c\n    0  1  0  0\n    1  0  1  0\n    2  0  0  1\n    3  1  0  0\n\n    See Also\n    --------\n    pandas.get_dummies\n    "
    if isinstance(data, (pd.Series, pd.DataFrame)):
        return pd.get_dummies(data, prefix=prefix, prefix_sep=prefix_sep, dummy_na=dummy_na, columns=columns, sparse=sparse, drop_first=drop_first, dtype=dtype, **kwargs)
    not_cat_msg = '`get_dummies` with non-categorical dtypes is not supported. Please use `df.categorize()` beforehand to convert to categorical dtype.'
    unknown_cat_msg = '`get_dummies` with unknown categories is not supported. Please use `column.cat.as_known()` or `df.categorize()` beforehand to ensure known categories'
    if isinstance(data, Series):
        if (not methods.is_categorical_dtype(data)):
            raise NotImplementedError(not_cat_msg)
        if (not has_known_categories(data)):
            raise NotImplementedError(unknown_cat_msg)
    elif isinstance(data, DataFrame):
        if (columns is None):
            if (data.dtypes == 'object').any():
                raise NotImplementedError(not_cat_msg)
            columns = data._meta.select_dtypes(include=['category']).columns
        elif (not all((methods.is_categorical_dtype(data[c]) for c in columns))):
            raise NotImplementedError(not_cat_msg)
        if (not all((has_known_categories(data[c]) for c in columns))):
            raise NotImplementedError(unknown_cat_msg)
    package_name = data._meta.__class__.__module__.split('.')[0]
    dummies = sys.modules[package_name].get_dummies
    return map_partitions(dummies, data, prefix=prefix, prefix_sep=prefix_sep, dummy_na=dummy_na, columns=columns, sparse=sparse, drop_first=drop_first, dtype=dtype, **kwargs)