Skip to content

Commit 9b9e975

Browse files
author
MarcoGorelli
committed
fixup some doc warnings
1 parent 9f56342 commit 9b9e975

File tree

8 files changed

+7
-5
lines changed

8 files changed

+7
-5
lines changed

doc/source/user_guide/categorical.rst

+1
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ Setting values by assigning categorical data will also check that the ``categori
787787
Assigning a ``Categorical`` to parts of a column of other types will use the values:
788788

789789
.. ipython:: python
790+
:okwarning:
790791
791792
df = pd.DataFrame({"a": [1, 1, 1, 1, 1], "b": ["a", "a", "a", "a", "a"]})
792793
df.loc[1:2, "a"] = pd.Categorical(["b", "b"], categories=["a", "b"])

doc/source/user_guide/cookbook.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Building criteria
125125

126126
.. ipython:: python
127127
128-
df.loc[(df["BBB"] > 25) | (df["CCC"] >= 75), "AAA"] = 0.1
128+
df.loc[(df["BBB"] > 25) | (df["CCC"] >= 75), "AAA"] = 999
129129
df
130130
131131
`Select rows with data closest to certain value using argsort

doc/source/user_guide/missing_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ the missing value type chosen:
123123

124124
.. ipython:: python
125125
126-
s = pd.Series([1, 2, 3])
126+
s = pd.Series([1., 2., 3.])
127127
s.loc[0] = None
128128
s
129129

doc/source/whatsnew/v0.15.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ Other notable API changes:
748748

749749
.. ipython:: python
750750
751-
s = pd.Series([1, 2, 3])
751+
s = pd.Series([1., 2., 3.])
752752
s.loc[0] = None
753753
s
754754

doc/source/whatsnew/v0.17.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to compar
738738

739739
.. ipython:: python
740740
741-
s = pd.Series(range(3))
741+
s = pd.Series(range(3), dtype="float")
742742
s.iloc[1] = None
743743
s
744744

doc/source/whatsnew/v0.21.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ Previously assignments, ``.where()`` and ``.fillna()`` with a ``bool`` assignmen
756756
New behavior
757757

758758
.. ipython:: python
759+
:okwarning:
759760
760761
s[1] = True
761762
s

doc/source/whatsnew/v1.3.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ Setting non-boolean values into a :class:`Series` with ``dtype=bool`` now consis
502502
casts to ``dtype=object`` (:issue:`38709`)
503503

504504
.. ipython:: python
505+
:okwarning:
505506
506507
orig = pd.Series([True, False])
507508
ser = orig.copy()

pandas/tests/groupby/test_groupby.py

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ def f_1(grp):
133133
result = df.groupby("A").apply(f_1)[["B"]]
134134
e = expected.copy()
135135
with tm.assert_produces_warning(FutureWarning, match="item of incompatible dtype"):
136-
# TODO is this right? Should it warn when setting new column?
137136
e.loc["Tiger"] = np.nan
138137
tm.assert_frame_equal(result, e)
139138

0 commit comments

Comments
 (0)