Skip to content

Commit ddcc7d3

Browse files
committed
Suppress warnings in docs
1 parent 2ead750 commit ddcc7d3

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

doc/source/user_guide/reshaping.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ values, can derive a :class:`DataFrame` containing ``k`` columns of 1s and 0s us
608608
:func:`~pandas.get_dummies`:
609609

610610
.. ipython:: python
611+
:okwarning:
611612
612613
df = pd.DataFrame({"key": list("bbacab"), "data1": range(6)})
613614
@@ -617,6 +618,7 @@ Sometimes it's useful to prefix the column names, for example when merging the r
617618
with the original :class:`DataFrame`:
618619

619620
.. ipython:: python
621+
:okwarning:
620622
621623
dummies = pd.get_dummies(df["key"], prefix="key")
622624
dummies
@@ -626,6 +628,7 @@ with the original :class:`DataFrame`:
626628
This function is often used along with discretization functions like :func:`~pandas.cut`:
627629

628630
.. ipython:: python
631+
:okwarning:
629632
630633
values = np.random.randn(10)
631634
values
@@ -642,6 +645,7 @@ variables (categorical in the statistical sense, those with ``object`` or
642645

643646

644647
.. ipython:: python
648+
:okwarning:
645649
646650
df = pd.DataFrame({"A": ["a", "b", "a"], "B": ["c", "c", "b"], "C": [1, 2, 3]})
647651
pd.get_dummies(df)
@@ -650,6 +654,7 @@ All non-object columns are included untouched in the output. You can control
650654
the columns that are encoded with the ``columns`` keyword.
651655

652656
.. ipython:: python
657+
:okwarning:
653658
654659
pd.get_dummies(df, columns=["A"])
655660
@@ -667,6 +672,7 @@ the prefix separator. You can specify ``prefix`` and ``prefix_sep`` in 3 ways:
667672
* dict: Mapping column name to prefix.
668673

669674
.. ipython:: python
675+
:okwarning:
670676
671677
simple = pd.get_dummies(df, prefix="new_prefix")
672678
simple
@@ -680,6 +686,7 @@ variable to avoid collinearity when feeding the result to statistical models.
680686
You can switch to this mode by turn on ``drop_first``.
681687

682688
.. ipython:: python
689+
:okwarning:
683690
684691
s = pd.Series(list("abcaa"))
685692
@@ -690,6 +697,7 @@ You can switch to this mode by turn on ``drop_first``.
690697
When a column contains only one level, it will be omitted in the result.
691698

692699
.. ipython:: python
700+
:okwarning:
693701
694702
df = pd.DataFrame({"A": list("aaaaa"), "B": list("ababc")})
695703

doc/source/whatsnew/v0.13.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ Enhancements
501501
- ``NaN`` handing in get_dummies (:issue:`4446`) with ``dummy_na``
502502

503503
.. ipython:: python
504+
:okwarning:
504505
505506
# previously, nan was erroneously counted as 2 here
506507
# now it is not counted at all

doc/source/whatsnew/v0.15.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ Other:
10071007
left untouched.
10081008

10091009
.. ipython:: python
1010+
:okwarning:
10101011
10111012
df = pd.DataFrame({'A': ['a', 'b', 'a'], 'B': ['c', 'c', 'b'],
10121013
'C': [1, 2, 3]})

doc/source/whatsnew/v0.19.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ The ``pd.get_dummies`` function now returns dummy-encoded columns as small integ
431431
**New behavior**:
432432

433433
.. ipython:: python
434+
:okwarning:
434435
435436
pd.get_dummies(["a", "b", "a", "c"]).dtypes
436437

doc/source/whatsnew/v0.23.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ Function ``get_dummies`` now supports ``dtype`` argument
366366
The :func:`get_dummies` now accepts a ``dtype`` argument, which specifies a dtype for the new columns. The default remains uint8. (:issue:`18330`)
367367

368368
.. ipython:: python
369+
:okwarning:
369370
370371
df = pd.DataFrame({'a': [1, 2], 'b': [3, 4], 'c': [5, 6]})
371372
pd.get_dummies(df, columns=['c']).dtypes

doc/source/whatsnew/v0.24.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ then all the columns are dummy-encoded, and a :class:`SparseDataFrame` was retur
833833
Now, the return type is consistently a :class:`DataFrame`.
834834

835835
.. ipython:: python
836+
:okwarning:
836837
837838
type(pd.get_dummies(df, sparse=True))
838839
type(pd.get_dummies(df[['B', 'C']], sparse=True))

0 commit comments

Comments
 (0)