Skip to content

Commit 5fe4140

Browse files
committed
CLN - Better way to import from collections.abc
DOC - Typo fix
1 parent be05ebd commit 5fe4140

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pandas/core/base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
Base and utility classes for pandas objects.
33
"""
44
import builtins
5-
from collections import OrderedDict, abc
5+
from collections import OrderedDict
6+
from collections.abc import Mapping
67
import textwrap
78
from typing import Dict, FrozenSet, List, Optional
89
import warnings
@@ -1215,7 +1216,7 @@ def _map_values(self, mapper, na_action=None):
12151216
# we can fastpath dict/Series to an efficient map
12161217
# as we know that we are not going to have to yield
12171218
# python types
1218-
if isinstance(mapper, abc.Mapping):
1219+
if isinstance(mapper, Mapping):
12191220
if isinstance(mapper, dict) and hasattr(mapper, "__missing__"):
12201221
# If a dictionary subclass defines a default value method,
12211222
# convert mapper to a lookup function (GH #15999).

pandas/core/series.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Data structure for 1-dimensional cross-sectional and time series data
33
"""
4-
from collections import abc
4+
from collections.abc import Mapping
55
from io import StringIO
66
from shutil import get_terminal_size
77
from textwrap import dedent
@@ -254,7 +254,7 @@ def __init__(
254254
else:
255255
data = data.reindex(index, copy=copy)
256256
data = data._data
257-
elif isinstance(data, abc.Mapping):
257+
elif isinstance(data, Mapping):
258258
data, index = self._init_dict(data, index, dtype)
259259
dtype = None
260260
copy = False
@@ -3618,7 +3618,7 @@ def map(self, arg, na_action=None):
36183618
36193619
Parameters
36203620
----------
3621-
arg : function, colletions.abc.Mapping subclass or Series
3621+
arg : function, collections.abc.Mapping subclass or Series
36223622
Mapping correspondence.
36233623
na_action : {None, 'ignore'}, default None
36243624
If 'ignore', propagate NaN values, without passing them to the

0 commit comments

Comments
 (0)