Skip to content

Commit ba00edb

Browse files
committed
okwarning option
1 parent 32f7e6d commit ba00edb

File tree

8 files changed

+12
-1
lines changed

8 files changed

+12
-1
lines changed

doc/source/user_guide/10min.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ Sorting is per order in the categories, not lexical order.
687687
Grouping by a categorical column also shows empty categories.
688688

689689
.. ipython:: python
690+
:okwarning:
690691
691692
df.groupby("grade").size()
692693

doc/source/user_guide/advanced.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ order is ``cab``).
792792
Groupby operations on the index will preserve the index nature as well.
793793

794794
.. ipython:: python
795+
:okwarning:
795796
796797
df2.groupby(level=0).sum()
797798
df2.groupby(level=0).sum().index

doc/source/user_guide/categorical.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,12 @@ even if some categories are not present in the data:
628628
categories=["c", "a", "b", "d"]))
629629
s.value_counts()
630630
631-
Groupby will also show "unused" categories:
631+
Groupby will also show "unused" categories, though this default is deprecated
632+
and will be changed in a future release. It is recommended to use the `observed`
633+
keyword explicitly:
632634

633635
.. ipython:: python
636+
:okwarning:
634637
635638
cats = pd.Categorical(["a", "b", "b", "b", "c", "c", "c"],
636639
categories=["a", "b", "c", "d"])
@@ -647,6 +650,7 @@ Groupby will also show "unused" categories:
647650
Pivot tables:
648651

649652
.. ipython:: python
653+
:okwarning:
650654
651655
raw_cat = pd.Categorical(["a", "a", "b", "b"], categories=["a", "b", "c"])
652656
df = pd.DataFrame({"A": raw_cat,

doc/source/user_guide/cookbook.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ The :ref:`Plotting <visualization>` docs.
900900
<https://stackoverflow.com/questions/23232989/boxplot-stratified-by-column-in-python-pandas>`__
901901

902902
.. ipython:: python
903+
:okwarning:
903904
904905
df = pd.DataFrame(
905906
{'stratifying_var': np.random.uniform(0, 100, 20),

doc/source/user_guide/groupby.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,7 @@ Categorical variables represented as instance of pandas's ``Categorical`` class
12231223
can be used as group keys. If so, the order of the levels will be preserved:
12241224

12251225
.. ipython:: python
1226+
:okwarning:
12261227
12271228
data = pd.Series(np.random.randn(100))
12281229

doc/source/whatsnew/v0.19.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,7 @@ An analogous change has been made to ``MultiIndex.from_product``.
11121112
As a consequence, ``groupby`` and ``set_index`` also preserve categorical dtypes in indexes
11131113

11141114
.. ipython:: python
1115+
:okwarning:
11151116
11161117
df = pd.DataFrame({'A': [0, 1], 'B': [10, 11], 'C': cat})
11171118
df_grouped = df.groupby(by=['A', 'C']).first()

doc/source/whatsnew/v0.20.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ In previous versions, ``.groupby(..., sort=False)`` would fail with a ``ValueErr
291291
**New behavior**:
292292

293293
.. ipython:: python
294+
:okwarning:
294295
295296
df[df.chromosomes != '1'].groupby('chromosomes', sort=False).sum()
296297

doc/source/whatsnew/v0.22.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ instead of ``NaN``.
118118
*pandas 0.22*
119119

120120
.. ipython:: python
121+
:okwarning:
121122
122123
grouper = pd.Categorical(['a', 'a'], categories=['a', 'b'])
123124
pd.Series([1, 2]).groupby(grouper).sum()

0 commit comments

Comments
 (0)