Skip to content

DOC: Remove Series.view(dtype=None) always trying float64 #20281

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
jorisvandenbossche opened this issue Mar 11, 2018 · 7 comments
Closed

DOC: Remove Series.view(dtype=None) always trying float64 #20281

jorisvandenbossche opened this issue Mar 11, 2018 · 7 comments
Labels

Comments

@jorisvandenbossche
Copy link
Member

xref https://github.com/pandas-dev/pandas/pull/20220/files#r173655704

Currently, Series.view() is actually equivalent to Series.view('float64') (because that is the default dtype in the Series constructor) which often does not make sense. Not too important (as there are not many reasons to use this function in pandas), but I think we should fix to either a) disallow dtype=None or either b) if dtype is None to set dtype = self.dtype (behaviour of numpy if no dtype is specified)

@jorisvandenbossche jorisvandenbossche changed the title Series.view without specified dtype Series.view() without specified dtype Mar 11, 2018
@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions labels Mar 11, 2018
@jreback
Copy link
Contributor

jreback commented Mar 11, 2018

ok, this is fine, though we should simply deprecate this.

@villasv
Copy link
Contributor

villasv commented Mar 11, 2018

I don't think this function is going to be used a lot, but I wouldn't mind leaving it there instead of deprecating it. I'm specially in favor of the second solutution (if dtype is None to set dtype = self.dtype)

@jreback
Copy link
Contributor

jreback commented Mar 11, 2018

@villasv see my comment son the other issue
this is pretty useful in the current memory model, causes bugs, is not tested and you can simply do this with .astype or use a numpy view directly if you want

having extra functions is plain confusing and just adds technical debt

@villasv
Copy link
Contributor

villasv commented Mar 11, 2018

Sound arguments, I'm in favor of keeping it but not specially attached to it. I won't miss it if it's gone. I'll try to keep discussions in the other issue only.

@mroeschke
Copy link
Member

Looks like this respects the original dtype now, so maybe just need to update the docs

@mroeschke mroeschke added Docs and removed Dtype Conversions Unexpected or buggy dtype conversions labels Apr 4, 2023
@mroeschke mroeschke changed the title Series.view() without specified dtype DOC: Removed Series.view(dtype=None) always trying float64 Apr 4, 2023
@mroeschke mroeschke changed the title DOC: Removed Series.view(dtype=None) always trying float64 DOC: Remove Series.view(dtype=None) always trying float64 Apr 4, 2023
@mroeschke mroeschke removed the Bug label Apr 4, 2023
@jorisvandenbossche
Copy link
Member Author

We can indeed certainly fix the docs, but IMO we should just deprecate it as well -> #20251

@jorisvandenbossche
Copy link
Member Author

The view() method has been deprecated now, so going to close this issue.

@jorisvandenbossche jorisvandenbossche closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants