Skip to content
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

BUG: to_datetime with Index arg does not retain name in all cases #21697

Closed
mroeschke opened this issue Jul 1, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@mroeschke
Copy link
Member

commented Jul 1, 2018

#Example

In [17]: idx = pd.Index([15e9], name='name')

In [18]: pd.to_datetime(idx, errors='ignore', box=True, unit='s').name

In [19]: pd.__version__
Out[19]: '0.24.0.dev0+193.gdc45fba'

There are certain cases where the name attribute of the passed Index are not retained after to_datetime.

The name kwarg looks to be missing from these locations:

return Index(result)

return Index(tz_results)

return Index(result)

@uds5501

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2018

@mroeschke Sir, for adding kwargs, will the following work?

return Index(result ,  {"name": name})
@mroeschke

This comment has been minimized.

Copy link
Member Author

commented Jul 2, 2018

Just simply, Index(..., name=name)

uds5501 added a commit to uds5501/pandas that referenced this issue Jul 3, 2018

uds5501 added a commit to uds5501/pandas that referenced this issue Jul 3, 2018

Update v0.24.0.txt
Adding whatsnew for pandas-dev#21697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.