File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2003,15 +2003,15 @@ def __contains__(self, key) -> bool_t:
2003
2003
@property
2004
2004
def empty (self ) -> bool_t :
2005
2005
"""
2006
- Indicator whether DataFrame is empty.
2006
+ Indicator whether Series/ DataFrame is empty.
2007
2007
2008
- True if DataFrame is entirely empty (no items), meaning any of the
2008
+ True if Series/ DataFrame is entirely empty (no items), meaning any of the
2009
2009
axes are of length 0.
2010
2010
2011
2011
Returns
2012
2012
-------
2013
2013
bool
2014
- If DataFrame is empty, return True, if not return False.
2014
+ If Series/ DataFrame is empty, return True, if not return False.
2015
2015
2016
2016
See Also
2017
2017
--------
@@ -2021,7 +2021,7 @@ def empty(self) -> bool_t:
2021
2021
2022
2022
Notes
2023
2023
-----
2024
- If DataFrame contains only NaNs, it is still not considered empty. See
2024
+ If Series/ DataFrame contains only NaNs, it is still not considered empty. See
2025
2025
the example below.
2026
2026
2027
2027
Examples
@@ -2047,6 +2047,16 @@ def empty(self) -> bool_t:
2047
2047
False
2048
2048
>>> df.dropna().empty
2049
2049
True
2050
+
2051
+ >>> ser_empty = pd.Series({'A' : []})
2052
+ >>> ser_empty
2053
+ A []
2054
+ dtype: object
2055
+ >>> ser_empty.empty
2056
+ False
2057
+ >>> ser_empty = pd.Series()
2058
+ >>> ser_empty.empty
2059
+ True
2050
2060
"""
2051
2061
return any (len (self ._get_axis (a )) == 0 for a in self ._AXIS_ORDERS )
2052
2062
You can’t perform that action at this time.
0 commit comments