diff --git a/doc/source/user_guide/boolean.rst b/doc/source/user_guide/boolean.rst index 3c361d4de17e5..1998fb82ffd40 100644 --- a/doc/source/user_guide/boolean.rst +++ b/doc/source/user_guide/boolean.rst @@ -37,6 +37,16 @@ If you would prefer to keep the ``NA`` values you can manually fill them with `` s[mask.fillna(True)] +Note that when creating a new column with only :attr:`pandas.NA` values, +its dtype will be ``"object"``, since the value is also used for +:ref:`nullable integers `. + +.. ipython:: python + + df = pd.DataFrame() + df['objects'] = pd.NA + df.dtypes + .. _boolean.kleene: Kleene logical operations diff --git a/doc/source/user_guide/integer_na.rst b/doc/source/user_guide/integer_na.rst index 1a727cd78af09..fdff02d20facd 100644 --- a/doc/source/user_guide/integer_na.rst +++ b/doc/source/user_guide/integer_na.rst @@ -84,6 +84,16 @@ with the dtype. In the future, we may provide an option for :class:`Series` to infer a nullable-integer dtype. +Note that when creating a new column with only :attr:`pandas.NA` values, +its dtype will be ``"object"``, since the value is also used for +:ref:`booleans `. + +.. ipython:: python + + df = pd.DataFrame() + df['objects'] = pd.NA + df.dtypes + Operations ----------