Skip to content

Commit ca35f4c

Browse files
committed
DOC: fix wording in whatsnew for get_dummies dtype argument
1 parent cb3156a commit ca35f4c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

doc/source/whatsnew/v0.22.0.txt

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,16 @@ Other Enhancements
2727
- :class:`pandas.io.formats.style.Styler` now has method ``hide_index()`` to determine whether the index will be rendered in ouptut (:issue:`14194`)
2828
- :class:`pandas.io.formats.style.Styler` now has method ``hide_columns()`` to determine whether columns will be hidden in output (:issue:`14194`)
2929

30-
``get_dummies`` now supports ``dtype`` argument
31-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
``get_dummies`` now supports ``dtype`` argument (:issue:`18330`)
31+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232

33-
:func:`get_dummies` function now accepts ``dtype`` argument, which forces specific dtype for new columns. When ``dtype`` is not specified or equals to ``None``, new columns will have dtype ``uint8`` (as before), so this change is backwards compatible. (:issue:`18330`)
34-
35-
**Previous behavior**:
36-
37-
.. ipython:: python
38-
39-
df = pd.DataFrame({'a': [1, 2], 'b': [3, 4], 'c': [5, 6]})
40-
pd.get_dummies(df, columns=['c'])
41-
42-
**New behavior**:
33+
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`)
4334

4435
.. ipython:: python
4536

4637
df = pd.DataFrame({'a': [1, 2], 'b': [3, 4], 'c': [5, 6]})
47-
pd.get_dummies(df, columns=['c'])
48-
pd.get_dummies(df, columns=['c'], dtype=bool)
49-
pd.get_dummies(df, columns=['c'], dtype=np.float64)
38+
pd.get_dummies(df, columns=['c']).dtypes
39+
pd.get_dummies(df, columns=['c'], dtype=bool).dtypes
5040

5141
.. _whatsnew_0220.api_breaking:
5242

0 commit comments

Comments
 (0)