Skip to content

DOC: infer_dtypes document is inconsistent with behaviour regarding boolean #38375

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
tsinggggg opened this issue Dec 8, 2020 · 9 comments · Fixed by #38499
Closed

DOC: infer_dtypes document is inconsistent with behaviour regarding boolean #38375

tsinggggg opened this issue Dec 8, 2020 · 9 comments · Fixed by #38499
Assignees
Labels
Docs Dtype Conversions Unexpected or buggy dtype conversions good first issue
Milestone

Comments

@tsinggggg
Copy link
Contributor

Location of the documentation

>>> infer_dtype([True, False, np.nan])

Documentation problem

In this example the return value should be 'boolean' as mentioned in this test case

arr = np.array([True, np.nan, False], dtype="O")

Suggested fix for documentation

change 'mix' to 'boolean'

@tsinggggg tsinggggg added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 8, 2020
@arw2019
Copy link
Member

arw2019 commented Dec 9, 2020

Am I misunderstanding or this isn't a docs problem? infer_dtypes returns mixed in this case

@arw2019 arw2019 removed the Needs Triage Issue that has not been reviewed by a pandas team member label Dec 9, 2020
@tsinggggg
Copy link
Contributor Author

Am I misunderstanding or this isn't a docs problem? infer_dtypes returns mixed in this case

@arw2019 i think it actually returns boolean, as shown in the test case

@arw2019
Copy link
Member

arw2019 commented Dec 9, 2020

is the difference that one is a python list holding [True, False, np.nan] versus an ndarray np.array([True, np.nan, False], dtype="O") constructed from that list

@tsinggggg
Copy link
Contributor Author

is the difference that one is a python list holding [True, False, np.nan] versus an ndarray np.array([True, np.nan, False], dtype="O") constructed from that list

it seems even with a list it's returning boolean
https://colab.research.google.com/drive/1s8kRGIkeQk2TXprc_Q2iYcNAT3u1QrPa?usp=sharing

@arw2019
Copy link
Member

arw2019 commented Dec 9, 2020

ok. Are you interested in submitting a PR with the correction?

(I know that in .py files we verify the docstrings but maybe in .pyx we don't...)

@tsinggggg
Copy link
Contributor Author

ok. Are you interested in submitting a PR with the correction?

(I know that in .py files we verify the docstrings but maybe in .pyx we don't...)

yes sure!

@rhshadrach rhshadrach added the Dtype Conversions Unexpected or buggy dtype conversions label Dec 10, 2020
@simonjayhawkins simonjayhawkins added this to the Contributions Welcome milestone Dec 13, 2020
@FullBeardDev
Copy link
Contributor

Hello there, as I'm starting to work on some open source contributions, I'm happy to submit a PR with the correction.

@tsinggggg
Copy link
Contributor Author

take

@tsinggggg
Copy link
Contributor Author

Hello there, as I'm starting to work on some open source contributions, I'm happy to submit a PR with the correction.

@DonPablo99 hey i just assigned this to myself and i started working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Dtype Conversions Unexpected or buggy dtype conversions good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants