File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -842,7 +842,25 @@ def __contains__(self, key):
842842
843843 @property
844844 def empty (self ):
845- """True if NDFrame is entirely empty [no items]"""
845+ """True if NDFrame is entirely empty [no items], i.e. all of the axes
846+ are of length 0.
847+
848+ Notes
849+ -----
850+ If NDFrame contains only NaNs, it is still not considered empty.
851+
852+ Examples
853+ --------
854+
855+ >>> # containing only NaNs does not make the df empty
856+ >>> df = pd.DataFrame({'A' : [np.nan]})
857+ >>> df.empty
858+ False
859+ >>> # if we drop NAs, the axes are now of length 0
860+ >>> df.dropna().empty
861+ True
862+
863+ """
846864 return not all (len (self ._get_axis (a )) > 0 for a in self ._AXIS_ORDERS )
847865
848866 def __nonzero__ (self ):
You can’t perform that action at this time.
0 commit comments