Skip to content

BUG : Adding *kwargs for name retention in Index args #21703

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

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pandas/core/tools/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def _convert_and_box_cache(arg, cache_array, box, errors, name=None):
result = Series(arg).map(cache_array)
if box:
if errors == 'ignore':
return Index(result)
return Index(result, {name: name})
else:
return DatetimeIndex(result, name=name)
return DatetimeIndex(result, {name: name})
return result.values


Expand Down Expand Up @@ -136,7 +136,7 @@ def _return_parsed_timezone_results(result, timezones, box, tz):
in zip(result, timezones)])
if box:
from pandas import Index
return Index(tz_results)
return Index(tz_results, name=name)
return tz_results


Expand Down Expand Up @@ -341,7 +341,7 @@ def _convert_listlike(arg, box, format, name=None, tz=tz):
if box:
if errors == 'ignore':
from pandas import Index
return Index(result)
return Index(result, name=name)

return DatetimeIndex(result, tz=tz, name=name)
return result
Expand Down