Skip to content

Commit 9cb7b99

Browse files
committed
Refactor Series import to optimize scope and maintain consistency
Moved the `Series` import inside relevant function scopes to minimize unnecessary top-level imports and align with existing import patterns. This helps improve code readability and ensures imports are only loaded where needed.
1 parent 5eba291 commit 9cb7b99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
)
5555
from pandas.core.dtypes.missing import isna
5656

57-
from pandas import Series
5857
import pandas.core.common as com
5958
from pandas.util.version import Version
6059

@@ -95,6 +94,7 @@
9594
from pandas import (
9695
DataFrame,
9796
Index,
97+
Series,
9898
)
9999

100100

@@ -1340,6 +1340,8 @@ def __init__(
13401340

13411341
@register_pandas_matplotlib_converters
13421342
def _make_plot(self, fig: Figure) -> None:
1343+
from pandas import Series
1344+
13431345
x, y, c, data = self.x, self.y, self.c, self.data
13441346
ax = self.axes[0]
13451347

0 commit comments

Comments
 (0)