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

DEPR: float/int(Series[single_element])? #51101

Closed
mroeschke opened this issue Feb 1, 2023 · 2 comments · Fixed by #51131
Closed

DEPR: float/int(Series[single_element])? #51101

mroeschke opened this issue Feb 1, 2023 · 2 comments · Fixed by #51131
Labels
Deprecate Functionality to remove in pandas

Comments

@mroeschke
Copy link
Member

In [1]: float(pd.Series([1]))
Out[1]: 1.0

In [2]: int(pd.Series([1]))
Out[2]: 1

Raises a TypeError if there's more than one element, but not sure the exact use case for the single element case. int(ser.iloc[0]) should probably be preferred.

@mroeschke mroeschke added the Deprecate Functionality to remove in pandas label Feb 1, 2023
@jbrockmendel
Copy link
Member

+1

@rhshadrach
Copy link
Member

+1; tangentially related - I've wondered what Series.bool and DataFrame.bool were for. They have similar logic (raise if there is more than one element).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants