Skip to content

DOC: Add examples and notes to empty documentation #12442

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
wants to merge 4 commits into from
Closed

DOC: Add examples and notes to empty documentation #12442

wants to merge 4 commits into from

Conversation

masongallo
Copy link
Contributor

Added notes and examples to provide clarity around the issue discussed in #12393. This is my first contribution to pandas, so let me know if I need to fix anything.

@masongallo masongallo changed the title Add examples and notes to empty documentation DOC: Add examples and notes to empty documentation Feb 24, 2016
@@ -842,7 +842,25 @@ def __contains__(self, key):

@property
def empty(self):
"""True if NDFrame is entirely empty [no items]"""
"""True if NDFrame is entirely empty [no items], i.e. all of the axes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any, not all

Examples
--------

>>> # containing only NaNs does not make the df empty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this a normal sentence (not a comment in the code block), and then leave a blank line between that and the code block on the following lines ?

@jorisvandenbossche
Copy link
Member

Thanks!

Further comment about the examples, I would start with an example of an actual empty frame (eg a DataFrame with only index), and only then show the example with the NaNs

@masongallo
Copy link
Contributor Author

Thanks to both of you. Your suggestions make sense to me. I'll make those tweaks and I thought of one additional in line with yours:

  • make comments actual sentences
  • start with empty df in example instead of NaN df
  • show output of empty df
  • also show output of NaN df

@jorisvandenbossche
Copy link
Member

That sounds good!

@jreback jreback added the Docs label Feb 25, 2016
@masongallo
Copy link
Contributor Author

Looks like travis hit a 404 from continuum's repo? I'm not seeing a 404 on my end.

Error: HTTPError: 404 Client Error: Not Found for url: https://repo.continuum.io/pkgs/free/linux-64/setuptools-20.1.1-py27_0.tar.bz2: https://repo.continuum.io/pkgs/free/linux-64/setuptools-20.1.1-py27_0.tar.bz2

@TomAugspurger
Copy link
Contributor

Their servers were having issues last night. I've restarted the build.

"""True if NDFrame is entirely empty [no items], i.e. any of the axes
are of length 0.

Notes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be below examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, do you mean move the entire notes section below examples?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is OK to leave it here (Jeff, in the html rendered version, the notes will also be before the examples, irregardless of how the order is here)

@jreback jreback closed this in e1cec52 Feb 26, 2016
@jreback
Copy link
Contributor

jreback commented Feb 26, 2016

thanks!

@jreback jreback added this to the 0.18.0 milestone Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing behaviour of df.empty
5 participants