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

DOC: use shared_docs for isna/notna & isnull/notnull #17096

Open
jreback opened this issue Jul 27, 2017 · 10 comments
Open

DOC: use shared_docs for isna/notna & isnull/notnull #17096

jreback opened this issue Jul 27, 2017 · 10 comments
Labels
Docs good first issue Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments

@jreback
Copy link
Contributor

jreback commented Jul 27, 2017

#16972

also some templates so that we can have distinctive doc-strings that use isnull in the doc-string for isnull (rather than isna), same for notnull.

@yadunathg
Copy link

Hi @jreback, I am a beginner here and want to work on this issue but am not able to find documentation of how to use shared_docs. Can you provide an example where shared_docs have been used?

@gfyoung
Copy link
Member

gfyoung commented Aug 15, 2017

@yadunathg : Awesome that you want to work on this? There is no documentation about how to use this, since it is an internal tool, but you can find an example here:

_shared_doc_kwargs = dict(

You can also search for _shared_docs in the GitHub search bar to find further examples in the pandas codebase.

@lermana
Copy link

lermana commented Sep 14, 2017

I don't know if this is the best place to leave this comment, and apologies if I should put this elsewhere. Wanted to bring attention to the fact that the docs. claim MultiIndex.isnull is implemented despite the fact that MultiIndex.isnull appears to be, for all intents and purposes, not implemented.

@gfyoung
Copy link
Member

gfyoung commented Sep 14, 2017

isnull is in fact implementd for MultiIndex (you can check yourself). However, isna is not. I think that should be fixed though @jreback ?

@lermana
Copy link

lermana commented Sep 14, 2017

@gfyoung thanks for the reply. well yes there is a isnull method for MultiIndex but it calls pandas/core/dtypes/missing._isna_new, which does not appear to be implemented for MultiIndex?

@gfyoung
Copy link
Member

gfyoung commented Sep 14, 2017

@lermana : Ah, yes, that's true. Then we should decide whether to implement it (long-term) or just patch the docs immediately. I think we should aim for the former if possible.

@lermana
Copy link

lermana commented Sep 14, 2017

@gfyoung cool! would def. be a neat feature to have.

A related question: for both isnull and duplicated DataFrame methods, is there a reason why the docs. don't specify that the functions don't actually look at the DF index / provide a link to the analogous Index functions?

Happy to submit a PR for the docs. updates if that would be helpful. Just something I was curious about, don't know if it's mentioned elsewhere in the API specification and missed it... this may not be the proper place for this thread.

@gfyoung
Copy link
Member

gfyoung commented Sep 14, 2017

Not AFAICT. Go for it then!

@lermana
Copy link

lermana commented Sep 14, 2017

Cool, will do!

@jreback jreback modified the milestones: 0.21.0, Next Major Release Sep 23, 2017
@mroeschke mroeschke added the Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate label Jun 12, 2021
@yihuajack
Copy link

The consequence of using _shared_docs is that the See also section of the references to isnull and notnull are not informative. For example, the See also section of isnull is

See Also
--------
DataFrame.isnull : Alias of isna.
DataFrame.notna : Boolean inverse of isna.
DataFrame.dropna : Omit axes labels with missing values.
isna : Top-level isna.

which is exactly the same as the See also section of isna. However, the following seems better:

See Also
--------
DataFrame.isna : Detect missing values.
DataFrame.notnull : Boolean inverse of isnull.
DataFrame.dropna : Omit axes labels with missing values.
isnull : Top-level isnull.

This issue is also mentioned in #27609.

@mroeschke mroeschke removed this from the Contributions Welcome milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs good first issue Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

No branches or pull requests

8 participants