8000 BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map by ThomasKluiters · Pull Request #25964 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map #25964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 19, 2019
Prev Previous commit
Next Next commit
Fix isort issue
  • Loading branch information
ThomasKluiters committed May 7, 2019
commit 339b155cfab6f01e9f4d65ea88b2b649eb010d70
6 changes: 3 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import warnings

import numpy as np
import pandas as pd

from pandas._config import get_option

from pandas._libs import iNaT, index as libindex, lib, tslibs
Expand All @@ -28,6 +28,7 @@
from pandas.core.dtypes.missing import (
isna, na_value_for_dtype, notna, remove_na_arraylike)

import pandas as pd
from pandas.core import algorithms, base, generic, nanops, ops
from pandas.core.accessor import CachedAccessor
from pandas.core.arrays import ExtensionArray, SparseArray
Expand Down Expand Up @@ -3679,10 +3680,9 @@ def f(x):
mapped = lib.map_infer(values, f, convert=convert_dtype)

if len(mapped) and isinstance(mapped[0], Series):
from pandas.core.frame import DataFrame
# GH 25959 use pd.array instead of tolist
# so extension arrays can be used
return DataFrame(pd.array(mapped), index=self.index)
return pd.DataFrame(pd.array(mapped), index=self.index)
else:
return self._constructor(mapped,
index=self.index).__finalize__(self)
Expand Down
0