Skip to content

Commit c3f9e7f

Browse files
committed
2 parents 074b3cb + 30d21de commit c3f9e7f

File tree

15 files changed

+36
-49
lines changed

15 files changed

+36
-49
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# ci
55
ci/ @mroeschke
66

7-
# web
8-
web/ @datapythonista
9-
107
# docs
118
doc/cheatsheet @Dr-Irv
129
doc/source/development @noatamir

doc/source/user_guide/window.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ which will first group the data by the specified keys and then perform a windowi
7070

7171
Some windowing aggregation, ``mean``, ``sum``, ``var`` and ``std`` methods may suffer from numerical
7272
imprecision due to the underlying windowing algorithms accumulating sums. When values differ
73-
with magnitude :math:`1/np.finfo(np.double).eps` this results in truncation. It must be
73+
with magnitude ``1/np.finfo(np.double).eps`` (approximately :math:`4.5 \times 10^{15}`),
74+
this results in truncation. It must be
7475
noted, that large values may have an impact on windows, which do not include these values. `Kahan summation
7576
<https://en.wikipedia.org/wiki/Kahan_summation_algorithm>`__ is used
7677
to compute the rolling sums to preserve accuracy as much as possible.

doc/source/whatsnew/v3.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ Other API changes
358358
- Made ``dtype`` a required argument in :meth:`ExtensionArray._from_sequence_of_strings` (:issue:`56519`)
359359
- Passing a :class:`Series` input to :func:`json_normalize` will now retain the :class:`Series` :class:`Index`, previously output had a new :class:`RangeIndex` (:issue:`51452`)
360360
- Removed :meth:`Index.sort` which always raised a ``TypeError``. This attribute is not defined and will raise an ``AttributeError`` (:issue:`59283`)
361+
- Unused ``dtype`` argument has been removed from the :class:`MultiIndex` constructor (:issue:`60962`)
361362
- Updated :meth:`DataFrame.to_excel` so that the output spreadsheet has no styling. Custom styling can still be done using :meth:`Styler.to_excel` (:issue:`54154`)
362363
- pickle and HDF (``.h5``) files created with Python 2 are no longer explicitly supported (:issue:`57387`)
363364
- pickled objects from pandas version less than ``1.0.0`` are no longer supported (:issue:`57155`)
@@ -818,6 +819,7 @@ Other
818819
- Bug in :meth:`DataFrame.transform` that was returning the wrong order unless the index was monotonically increasing. (:issue:`57069`)
819820
- Bug in :meth:`DataFrame.where` where using a non-bool type array in the function would return a ``ValueError`` instead of a ``TypeError`` (:issue:`56330`)
820821
- Bug in :meth:`Index.sort_values` when passing a key function that turns values into tuples, e.g. ``key=natsort.natsort_key``, would raise ``TypeError`` (:issue:`56081`)
822+
- Bug in :meth:`MultiIndex.fillna` error message was referring to ``isna`` instead of ``fillna`` (:issue:`60974`)
821823
- Bug in :meth:`Series.diff` allowing non-integer values for the ``periods`` argument. (:issue:`56607`)
822824
- Bug in :meth:`Series.dt` methods in :class:`ArrowDtype` that were returning incorrect values. (:issue:`57355`)
823825
- Bug in :meth:`Series.isin` raising ``TypeError`` when series is large (>10**6) and ``values`` contains NA (:issue:`60678`)

pandas/core/indexes/multi.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ class MultiIndex(Index):
212212
level).
213213
names : optional sequence of objects
214214
Names for each of the index levels. (name is accepted for compat).
215-
dtype : Numpy dtype or pandas type, optional
216-
Data type for the MultiIndex.
217215
copy : bool, default False
218216
Copy the meta-data.
219217
name : Label
@@ -305,7 +303,6 @@ def __new__(
305303
codes=None,
306304
sortorder=None,
307305
names=None,
308-
dtype=None,
309306
copy: bool = False,
310307
name=None,
311308
verify_integrity: bool = True,
@@ -1760,7 +1757,7 @@ def fillna(self, value):
17601757
"""
17611758
fillna is not implemented for MultiIndex
17621759
"""
1763-
raise NotImplementedError("isna is not defined for MultiIndex")
1760+
raise NotImplementedError("fillna is not defined for MultiIndex")
17641761

17651762
@doc(Index.dropna)
17661763
def dropna(self, how: AnyAll = "any") -> MultiIndex:

pandas/core/series.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,7 +4651,7 @@ def rename(
46514651
inplace: Literal[True],
46524652
level: Level | None = ...,
46534653
errors: IgnoreRaise = ...,
4654-
) -> None: ...
4654+
) -> Series | None: ...
46554655

46564656
@overload
46574657
def rename(
@@ -4665,18 +4665,6 @@ def rename(
46654665
errors: IgnoreRaise = ...,
46664666
) -> Series: ...
46674667

4668-
@overload
4669-
def rename(
4670-
self,
4671-
index: Renamer | Hashable | None = ...,
4672-
*,
4673-
axis: Axis | None = ...,
4674-
copy: bool | lib.NoDefault = ...,
4675-
inplace: bool = ...,
4676-
level: Level | None = ...,
4677-
errors: IgnoreRaise = ...,
4678-
) -> Series | None: ...
4679-
46804668
def rename(
46814669
self,
46824670
index: Renamer | Hashable | None = None,
@@ -4734,8 +4722,9 @@ def rename(
47344722
47354723
Returns
47364724
-------
4737-
Series or None
4738-
Series with index labels or name altered or None if ``inplace=True``.
4725+
Series
4726+
A shallow copy with index labels or name altered, or the same object
4727+
if ``inplace=True`` and index is not a dict or callable else None.
47394728
47404729
See Also
47414730
--------

pandas/core/strings/accessor.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3549,12 +3549,29 @@ def casefold(self):
35493549
also includes other characters that can represent quantities such as
35503550
unicode fractions.
35513551
3552-
>>> s1 = pd.Series(['one', 'one1', '1', ''])
3552+
>>> s1 = pd.Series(['one', 'one1', '1', '', '³', '⅕'])
35533553
>>> s1.str.isnumeric()
35543554
0 False
35553555
1 False
35563556
2 True
35573557
3 False
3558+
4 True
3559+
5 True
3560+
dtype: bool
3561+
3562+
For a string to be considered numeric, all its characters must have a Unicode
3563+
numeric property matching :py:meth:`str.is_numeric`. As a consequence,
3564+
the following cases are **not** recognized as numeric:
3565+
3566+
- **Decimal numbers** (e.g., "1.1"): due to period ``"."``
3567+
- **Negative numbers** (e.g., "-5"): due to minus sign ``"-"``
3568+
- **Scientific notation** (e.g., "1e3"): due to characters like ``"e"``
3569+
3570+
>>> s2 = pd.Series(["1.1", "-5", "1e3"])
3571+
>>> s2.str.isnumeric()
3572+
0 False
3573+
1 False
3574+
2 False
35583575
dtype: bool
35593576
"""
35603577
_shared_docs["isalnum"] = """

pandas/io/formats/style.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ class Styler(StylerRenderer):
187187
188188
Attributes
189189
----------
190+
index : data.index Index
191+
columns : data.columns Index
190192
env : Jinja2 jinja2.Environment
191193
template_html : Jinja2 Template
192194
template_html_table : Jinja2 Template

pandas/tests/base/test_fillna.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_fillna(index_or_series_obj):
1616
obj = index_or_series_obj
1717

1818
if isinstance(obj, MultiIndex):
19-
msg = "isna is not defined for MultiIndex"
19+
msg = "fillna is not defined for MultiIndex"
2020
with pytest.raises(NotImplementedError, match=msg):
2121
obj.fillna(0)
2222
return

pandas/tests/indexes/multi/test_missing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
def test_fillna(idx):
1010
# GH 11343
11-
msg = "isna is not defined for MultiIndex"
11+
msg = "fillna is not defined for MultiIndex"
1212
with pytest.raises(NotImplementedError, match=msg):
1313
idx.fillna(idx[0])
1414

pandas/tests/indexes/test_old_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def test_fillna(self, index):
597597
pytest.skip(f"Not relevant for Index with {index.dtype}")
598598
elif isinstance(index, MultiIndex):
599599
idx = index.copy(deep=True)
600-
msg = "isna is not defined for MultiIndex"
600+
msg = "fillna is not defined for MultiIndex"
601601
with pytest.raises(NotImplementedError, match=msg):
602602
idx.fillna(idx[0])
603603
else:

0 commit comments

Comments
 (0)