Skip to content

Commit 4f05540

Browse files
committed
Update
1 parent d7a7eca commit 4f05540

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

doc/source/user_guide/io.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ dtype : Type name or dict of column -> type, default ``None``
197197
Support for defaultdict was added. Specify a defaultdict as input where
198198
the default determines the dtype of the columns which are not explicitly
199199
listed.
200+
201+
use_nullable_dtypes: bool = False
202+
Whether or not to use nullable dtypes as default when reading data. If
203+
set to True, nullable dtypes are used for all dtypes that have a nullable
204+
implementation, even if no nulls are present.
205+
206+
.. versionadded:: 2.0
207+
200208
engine : {``'c'``, ``'python'``, ``'pyarrow'``}
201209
Parser engine to use. The C and pyarrow engines are faster, while the python engine
202210
is currently more feature-complete. Multithreading is currently only supported by

pandas/_libs/parsers.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,6 @@ cdef class TextReader:
10571057
self._free_na_set(na_hashset)
10581058

10591059
# don't try to upcast EAs
1060-
print(col_dtype)
10611060
if (
10621061
na_count > 0 and not is_extension_array_dtype(col_dtype)
10631062
or self.use_nullable_dtypes

pandas/io/parsers/base_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ def _infer_types(self, values, na_values, cast_type, try_num_bool: bool = True):
735735
else:
736736
if use_nullable_dtypes:
737737
if result_mask is None:
738-
result_mask = np.zeros(result.shape, dtype="bool")
738+
result_mask = np.zeros(result.shape, dtype=np.bool_)
739739

740740
if is_integer_dtype(result):
741741
result = IntegerArray(result, result_mask)

0 commit comments

Comments
 (0)