|
67 | 67 | ) |
68 | 68 | from pandas.util._decorators import ( |
69 | 69 | deprecate_nonkeyword_arguments, |
| 70 | + doc, |
70 | 71 | set_module, |
71 | 72 | ) |
72 | 73 | from pandas.util._exceptions import ( |
@@ -7509,75 +7510,10 @@ def isna(self) -> DataFrame: |
7509 | 7510 | result = self._constructor_from_mgr(res_mgr, axes=res_mgr.axes) |
7510 | 7511 | return result.__finalize__(self, method="isna") |
7511 | 7512 |
|
| 7513 | + @doc(NDFrame.isna, klass=_shared_doc_kwargs["klass"]) |
7512 | 7514 | def isnull(self) -> DataFrame: |
7513 | | - """DataFrame.isnull is an alias for DataFrame.isna. |
7514 | | - |
7515 | | - Detect missing values. |
7516 | | - |
7517 | | - Return a boolean same-sized object indicating if the values are NA. |
7518 | | - NA values, such as None or :attr:`numpy.NaN`, gets mapped to True |
7519 | | - values. |
7520 | | - Everything else gets mapped to False values. Characters such as empty |
7521 | | - strings ``''`` or :attr:`numpy.inf` are not considered NA values. |
7522 | | - |
7523 | | - Returns |
7524 | | - ------- |
7525 | | - Series/DataFrame |
7526 | | - Mask of bool values for each element in Series/DataFrame |
7527 | | - that indicates whether an element is an NA value. |
7528 | | - |
7529 | | - See Also |
7530 | | - -------- |
7531 | | - Series.isnull : Alias of isna. |
7532 | | - DataFrame.isnull : Alias of isna. |
7533 | | - Series.notna : Boolean inverse of isna. |
7534 | | - DataFrame.notna : Boolean inverse of isna. |
7535 | | - Series.dropna : Omit axes labels with missing values. |
7536 | | - DataFrame.dropna : Omit axes labels with missing values. |
7537 | | - isna : Top-level isna. |
7538 | | - |
7539 | | - Examples |
7540 | | - -------- |
7541 | | - Show which entries in a DataFrame are NA. |
7542 | | - |
7543 | | - >>> df = pd.DataFrame( |
7544 | | - ... dict( |
7545 | | - ... age=[5, 6, np.nan], |
7546 | | - ... born=[ |
7547 | | - ... pd.NaT, |
7548 | | - ... pd.Timestamp("1939-05-27"), |
7549 | | - ... pd.Timestamp("1940-04-25"), |
7550 | | - ... ], |
7551 | | - ... name=["Alfred", "Batman", ""], |
7552 | | - ... toy=[None, "Batmobile", "Joker"], |
7553 | | - ... ) |
7554 | | - ... ) |
7555 | | - >>> df |
7556 | | - age born name toy |
7557 | | - 0 5.0 NaT Alfred NaN |
7558 | | - 1 6.0 1939-05-27 Batman Batmobile |
7559 | | - 2 NaN 1940-04-25 Joker |
7560 | | - |
7561 | | - >>> df.isna() |
7562 | | - age born name toy |
7563 | | - 0 False True False True |
7564 | | - 1 False False False False |
7565 | | - 2 True False False False |
7566 | | - |
7567 | | - Show which entries in a Series are NA. |
7568 | | - |
7569 | | - >>> ser = pd.Series([5, 6, np.nan]) |
7570 | | - >>> ser |
7571 | | - 0 5.0 |
7572 | | - 1 6.0 |
7573 | | - 2 NaN |
7574 | | - dtype: float64 |
7575 | | - |
7576 | | - >>> ser.isna() |
7577 | | - 0 False |
7578 | | - 1 False |
7579 | | - 2 True |
7580 | | - dtype: bool |
| 7515 | + """ |
| 7516 | + DataFrame.isnull is an alias for DataFrame.isna. |
7581 | 7517 | """ |
7582 | 7518 | return self.isna() |
7583 | 7519 |
|
@@ -7652,75 +7588,10 @@ def notna(self) -> DataFrame: |
7652 | 7588 | """ |
7653 | 7589 | return ~self.isna() |
7654 | 7590 |
|
| 7591 | + @doc(NDFrame.notna, klass=_shared_doc_kwargs["klass"]) |
7655 | 7592 | def notnull(self) -> DataFrame: |
7656 | | - """DataFrame.notnull is an alias for DataFrame.notna. |
7657 | | - |
7658 | | - Detect existing (non-missing) values. |
7659 | | - |
7660 | | - Return a boolean same-sized object indicating if the values are not NA. |
7661 | | - Non-missing values get mapped to True. Characters such as empty |
7662 | | - strings ``''`` or :attr:`numpy.inf` are not considered NA values. |
7663 | | - NA values, such as None or :attr:`numpy.NaN`, get mapped to False |
7664 | | - values. |
7665 | | - |
7666 | | - Returns |
7667 | | - ------- |
7668 | | - Series/DataFrame |
7669 | | - Mask of bool values for each element in Series/DataFrame |
7670 | | - that indicates whether an element is not an NA value. |
7671 | | - |
7672 | | - See Also |
7673 | | - -------- |
7674 | | - Series.notnull : Alias of notna. |
7675 | | - DataFrame.notnull : Alias of notna. |
7676 | | - Series.isna : Boolean inverse of notna. |
7677 | | - DataFrame.isna : Boolean inverse of notna. |
7678 | | - Series.dropna : Omit axes labels with missing values. |
7679 | | - DataFrame.dropna : Omit axes labels with missing values. |
7680 | | - notna : Top-level notna. |
7681 | | - |
7682 | | - Examples |
7683 | | - -------- |
7684 | | - Show which entries in a DataFrame are not NA. |
7685 | | - |
7686 | | - >>> df = pd.DataFrame( |
7687 | | - ... dict( |
7688 | | - ... age=[5, 6, np.nan], |
7689 | | - ... born=[ |
7690 | | - ... pd.NaT, |
7691 | | - ... pd.Timestamp("1939-05-27"), |
7692 | | - ... pd.Timestamp("1940-04-25"), |
7693 | | - ... ], |
7694 | | - ... name=["Alfred", "Batman", ""], |
7695 | | - ... toy=[None, "Batmobile", "Joker"], |
7696 | | - ... ) |
7697 | | - ... ) |
7698 | | - >>> df |
7699 | | - age born name toy |
7700 | | - 0 5.0 NaT Alfred NaN |
7701 | | - 1 6.0 1939-05-27 Batman Batmobile |
7702 | | - 2 NaN 1940-04-25 Joker |
7703 | | - |
7704 | | - >>> df.notna() |
7705 | | - age born name toy |
7706 | | - 0 True False True False |
7707 | | - 1 True True True True |
7708 | | - 2 False True True True |
7709 | | - |
7710 | | - Show which entries in a Series are not NA. |
7711 | | - |
7712 | | - >>> ser = pd.Series([5, 6, np.nan]) |
7713 | | - >>> ser |
7714 | | - 0 5.0 |
7715 | | - 1 6.0 |
7716 | | - 2 NaN |
7717 | | - dtype: float64 |
7718 | | - |
7719 | | - >>> ser.notna() |
7720 | | - 0 True |
7721 | | - 1 True |
7722 | | - 2 False |
7723 | | - dtype: bool |
| 7593 | + """ |
| 7594 | + DataFrame.notnull is an alias for DataFrame.notna. |
7724 | 7595 | """ |
7725 | 7596 | return ~self.isna() |
7726 | 7597 |
|
|
0 commit comments