Skip to content

Commit

Permalink
DOC: update whatsnew style, minore codestyle change
Browse files Browse the repository at this point in the history
  • Loading branch information
Scorpil committed Nov 22, 2017
1 parent bc192fd commit d19d81f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.22.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ New features
``get_dummies`` now supports ``dtype`` argument
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :func:`get_dummies` now accepts a ``dtype`` argument, which specifies a specific dtype for the new columns. When ``dtype`` is not specified or ``None``, the dtype will be ``uint8`` as before. (:issue:`18330`)
The :func:`get_dummies` now accepts a ``dtype`` argument, which specifies a dtype for the new columns. The default remains uint8. (:issue:`18330`)

.. ipython:: python

Expand Down
3 changes: 1 addition & 2 deletions pandas/core/reshape/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,7 @@ def _get_dummies_1d(data, prefix, prefix_sep='_', dummy_na=False,

if dtype is None:
dtype = np.uint8
else:
dtype = np.dtype(dtype)
dtype = np.dtype(dtype)

if is_object_dtype(dtype):
raise ValueError("dtype=object is not a valid dtype for get_dummies")
Expand Down

0 comments on commit d19d81f

Please sign in to comment.