Skip to content

Commit 83e2644

Browse files
committed
More doc fixes
1 parent f6a2330 commit 83e2644

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

pandas/core/arrays/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ def argmin(self, skipna: bool = True) -> int:
941941
--------
942942
>>> arr = pd.array([3, 1, 2, 5, 4])
943943
>>> arr.argmin()
944-
1
944+
np.int64(1)
945945
"""
946946
# Implementer note: You have two places to override the behavior of
947947
# argmin.
@@ -975,7 +975,7 @@ def argmax(self, skipna: bool = True) -> int:
975975
--------
976976
>>> arr = pd.array([3, 1, 2, 5, 4])
977977
>>> arr.argmax()
978-
3
978+
np.int64(3)
979979
"""
980980
# Implementer note: You have two places to override the behavior of
981981
# argmax.
@@ -2182,9 +2182,9 @@ def _reduce(
21822182
>>> pd.array([1, 2, 3])._reduce("sum")
21832183
np.int64(6)
21842184
>>> pd.array([1, 2, 3])._reduce("mean")
2185-
2.0
2185+
np.float64(2.0)
21862186
>>> pd.array([1, 2, 3])._reduce("median")
2187-
2.0
2187+
np.float64(2.0)
21882188
"""
21892189
meth = getattr(self, name, None)
21902190
if meth is None:

pandas/core/arrays/masked.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,25 +1382,25 @@ def any(
13821382
skips NAs):
13831383
13841384
>>> pd.array([True, False, True]).any()
1385-
True
1385+
np.True_
13861386
>>> pd.array([True, False, pd.NA]).any()
1387-
True
1387+
np.True_
13881388
>>> pd.array([False, False, pd.NA]).any()
1389-
False
1389+
np.False_
13901390
>>> pd.array([], dtype="boolean").any()
1391-
False
1391+
np.False_
13921392
>>> pd.array([pd.NA], dtype="boolean").any()
1393-
False
1393+
np.False_
13941394
>>> pd.array([pd.NA], dtype="Float64").any()
1395-
False
1395+
np.False_
13961396
13971397
With ``skipna=False``, the result can be NA if this is logically
13981398
required (whether ``pd.NA`` is True or False influences the result):
13991399
14001400
>>> pd.array([True, False, pd.NA]).any(skipna=False)
1401-
True
1401+
np.True_
14021402
>>> pd.array([1, 0, pd.NA]).any(skipna=False)
1403-
True
1403+
np.True_
14041404
>>> pd.array([False, False, pd.NA]).any(skipna=False)
14051405
<NA>
14061406
>>> pd.array([0, 0, pd.NA]).any(skipna=False)
@@ -1490,9 +1490,9 @@ def all(
14901490
>>> pd.array([1, 1, pd.NA]).all(skipna=False)
14911491
<NA>
14921492
>>> pd.array([True, False, pd.NA]).all(skipna=False)
1493-
False
1493+
np.False_
14941494
>>> pd.array([1, 0, pd.NA]).all(skipna=False)
1495-
False
1495+
np.False_
14961496
"""
14971497
nv.validate_all((), kwargs)
14981498

pandas/core/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ def factorize(
13791379
dtype: datetime64[s]
13801380
13811381
>>> ser.searchsorted('3/14/2000')
1382-
3
1382+
np.int64(3)
13831383
13841384
>>> ser = pd.Categorical(
13851385
... ['apple', 'bread', 'bread', 'cheese', 'milk'], ordered=True

pandas/core/construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def array(
186186
187187
>>> pd.array(["a", "b"], dtype=np.dtype("<U1"))
188188
<NumpyExtensionArray>
189-
['a', 'b']
189+
[np.str_('a'), np.str_('b')]
190190
Length: 2, dtype: str32
191191
192192
Finally, Pandas has arrays that mostly overlap with NumPy

pandas/core/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ def squeeze(self, axis: Axis | None = None) -> Scalar | Series | DataFrame:
945945
Squeezing all axes will project directly into a scalar:
946946
947947
>>> df_0a.squeeze()
948-
1
948+
np.int64(1)
949949
"""
950950
axes = range(self._AXIS_LEN) if axis is None else (self._get_axis_number(axis),)
951951
result = self.iloc[
@@ -7969,7 +7969,7 @@ def asof(self, where, subset=None):
79697969
NaN, even though NaN is at the index location for ``30``.
79707970
79717971
>>> s.asof(30)
7972-
2.0
7972+
np.float64(2.0)
79737973
79747974
Take all columns into consideration
79757975

pandas/core/indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def loc(self) -> _LocIndexer:
585585
Single tuple for the index with a single label for the column
586586
587587
>>> df.loc[("cobra", "mark i"), "shield"]
588-
2
588+
np.int64(2)
589589
590590
Slice from index tuple to single label
591591
@@ -677,7 +677,7 @@ def at(self) -> _AtIndexer:
677677
Get value within a Series
678678
679679
>>> df.loc[5].at["B"]
680-
np.int64(5)
680+
np.int64(4)
681681
"""
682682
return _AtIndexer("at", self)
683683

0 commit comments

Comments
 (0)