Skip to content

Commit

Permalink
DOC: add get_dummies dtype argument description to reshaping.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Scorpil committed Nov 22, 2017
1 parent f39f015 commit 8ab9859
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions doc/source/reshaping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,17 @@ When a column contains only one level, it will be omitted in the result.
pd.get_dummies(df, drop_first=True)
By default new columns will have ``np.uint8`` dtype. To choose another dtype use ``dtype`` argument:

.. ipython:: python
df = pd.DataFrame({'A': list('abc'), 'B': [1.1, 2.2, 3.3]})
pd.get_dummies(df, dtype=bool).dtypes
.. versionadded:: 0.22.0


.. _reshaping.factorize:

Factorizing values
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/reshape/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False,
.. versionadded:: 0.18.0
dtype : dtype, default np.uint8
Data type to force on a new columns. Only a single dtype is allowed.
Data type for new columns. Only a single dtype is allowed.
.. versionadded:: 0.22.0
Expand Down

0 comments on commit 8ab9859

Please sign in to comment.