File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,19 @@ If you would prefer to keep the ``NA`` values you can manually fill them with ``
37
37
38
38
s[mask.fillna(True )]
39
39
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="boolean") ``
45
+ (or another ``dtype `` that supports ``NA ``).
46
+
47
+ .. ipython :: python
48
+
49
+ df = pd.DataFrame()
50
+ df[' objects' ] = pd.NA
51
+ df.dtypes
52
+
40
53
.. _boolean.kleene :
41
54
42
55
Kleene logical operations
Original file line number Diff line number Diff line change @@ -84,6 +84,19 @@ with the dtype.
84
84
In the future, we may provide an option for :class: `Series ` to infer a
85
85
nullable-integer dtype.
86
86
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 `` that supports ``NA ``).
93
+
94
+ .. ipython :: python
95
+
96
+ df = pd.DataFrame()
97
+ df[' objects' ] = pd.NA
98
+ df.dtypes
99
+
87
100
Operations
88
101
----------
89
102
You can’t perform that action at this time.
0 commit comments