|
87 | 87 | from pandas.core.dtypes.missing import isna, notna
|
88 | 88 |
|
89 | 89 | import pandas as pd
|
90 |
| -from pandas.core import arraylike, indexing, missing, nanops |
91 |
| -import pandas.core.algorithms as algos |
| 90 | +from pandas.core import ( |
| 91 | + algorithms as algos, |
| 92 | + arraylike, |
| 93 | + common as com, |
| 94 | + indexing, |
| 95 | + missing, |
| 96 | + nanops, |
| 97 | +) |
92 | 98 | from pandas.core.base import PandasObject, SelectionMixin
|
93 |
| -import pandas.core.common as com |
94 | 99 | from pandas.core.construction import create_series_with_explicit_dtype
|
95 | 100 | from pandas.core.flags import Flags
|
96 | 101 | from pandas.core.indexes import base as ibase
|
@@ -6027,10 +6032,7 @@ def _convert(
|
6027 | 6032 | validate_bool_kwarg(timedelta, "timedelta")
|
6028 | 6033 | return self._constructor(
|
6029 | 6034 | self._mgr.convert(
|
6030 |
| - datetime=datetime, |
6031 |
| - numeric=numeric, |
6032 |
| - timedelta=timedelta, |
6033 |
| - copy=True, |
| 6035 | + datetime=datetime, numeric=numeric, timedelta=timedelta, copy=True, |
6034 | 6036 | )
|
6035 | 6037 | ).__finalize__(self)
|
6036 | 6038 |
|
@@ -6880,10 +6882,7 @@ def replace(
|
6880 | 6882 | f"Expecting {len(to_replace)} got {len(value)} "
|
6881 | 6883 | )
|
6882 | 6884 | new_data = self._mgr.replace_list(
|
6883 |
| - src_list=to_replace, |
6884 |
| - dest_list=value, |
6885 |
| - inplace=inplace, |
6886 |
| - regex=regex, |
| 6885 | + src_list=to_replace, dest_list=value, inplace=inplace, regex=regex, |
6887 | 6886 | )
|
6888 | 6887 |
|
6889 | 6888 | elif to_replace is None:
|
@@ -10545,7 +10544,8 @@ def pct_change(
|
10545 | 10544 | def _agg_by_level(self, name, axis=0, level=0, skipna=True, **kwargs):
|
10546 | 10545 | if axis is None:
|
10547 | 10546 | raise ValueError("Must specify 'axis' when aggregating by level.")
|
10548 |
| - grouped = self.groupby(level=level, axis=axis, sort=False) |
| 10547 | + # see pr-35967 for discussion about the observed keyword |
| 10548 | + grouped = self.groupby(level=level, axis=axis, sort=False, observed=False) |
10549 | 10549 | if hasattr(grouped, name) and skipna:
|
10550 | 10550 | return getattr(grouped, name)(**kwargs)
|
10551 | 10551 | axis = self._get_axis_number(axis)
|
|
0 commit comments