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

COMPAT: alias .to_numpy() for scalars #24653

Closed
jreback opened this issue Jan 6, 2019 · 4 comments · Fixed by #25142
Closed

COMPAT: alias .to_numpy() for scalars #24653

jreback opened this issue Jan 6, 2019 · 4 comments · Fixed by #25142
Labels
Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype Timedelta Timedelta data type
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jan 6, 2019

I think we achieve a bit more consistency in our interfaces if we alias .to_numpy() to .to_datetime64() and .to_timedelta64() for Timedelta and Timestamp respectively.

xref https://github.com/pandas-dev/pandas/pull/24486/files#diff-26a6d2ca7adfca586aabbb1c9dd8bf36L235

@jreback jreback added Datetime Datetime data dtype Timedelta Timedelta data type Compat pandas objects compatability with Numpy or Python functions labels Jan 6, 2019
@jreback jreback added this to the Contributions Welcome milestone Jan 6, 2019
@jbrockmendel
Copy link
Member

Could do the same for to_py, I think arrow does this

@jreback
Copy link
Contributor Author

jreback commented Jan 6, 2019

yep

@cbertinato
Copy link
Contributor

What should we do for the to_numpy() keyword arguments? Neither dtype nor copy make sense in the case of a scalar. Just let it raise the TypeError if either is passed, or accept the arguments and do nothing?

@jreback
Copy link
Contributor Author

jreback commented Jan 27, 2019

i think it’s ok to have them i. the signature for compatibility (default to None); but they will be ignored

@jreback jreback modified the milestones: Contributions Welcome, 0.25.0 Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants