Skip to content

Commit 61de055

Browse files
committed
fix 49201
1 parent 9e7abc8 commit 61de055

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

doc/source/user_guide/boolean.rst

+12
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ If you would prefer to keep the ``NA`` values you can manually fill them with ``
3737
3838
s[mask.fillna(True)]
3939
40+
If you create a column of ``NA`` values (for example to fill them later)
41+
with ``df['new_col'] = pd.NA``, the ``dtype`` would be set to ``object`` in the
42+
new column. The performance on this column will be worse than with
43+
the appropriate type. It's better to use
44+
``df['new_col'] = pd.Series(pd.NA, dtype=Int64)``
45+
(or another ``dtype`` as you desire).
46+
47+
.. ipython:: python
48+
df = pd.DataFrame()
49+
df['objects'] = pd.NA
50+
df.dtypes
51+
4052
.. _boolean.kleene:
4153

4254
Kleene logical operations

doc/source/user_guide/integer_na.rst

+12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ with the dtype.
8484
In the future, we may provide an option for :class:`Series` to infer a
8585
nullable-integer dtype.
8686

87+
If you create a column of ``NA`` values (for example to fill them later)
88+
with ``df['new_col'] = pd.NA``, the ``dtype`` would be set to ``object`` in the
89+
new column. The performance on this column will be worse than with
90+
the appropriate type. It's better to use
91+
``df['new_col'] = pd.Series(pd.NA, dtype=Int64)``
92+
(or another ``dtype`` as you desire).
93+
94+
.. ipython:: python
95+
df = pd.DataFrame()
96+
df['objects'] = pd.NA
97+
df.dtypes
98+
8799
Operations
88100
----------
89101

0 commit comments

Comments
 (0)