Skip to content

Commit 18839b9

Browse files
committed
Using numpy array from return if possible
1 parent b23055a commit 18839b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexes/datetimelike.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def map(self, f):
351351

352352
# Try to use this result if we can
353353
if isinstance(result, np.ndarray):
354-
self._shallow_copy(result)
354+
result = Index(result)
355355

356356
if not isinstance(result, Index):
357357
raise TypeError('The map function must return an Index object')

0 commit comments

Comments
 (0)