Skip to content

Commit 644d74b

Browse files
committed
fixed formatting of default na values
1 parent 1fa5025 commit 644d74b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pandas/io/parsers/readers.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
142142
_read_shared = dict
143143

144144

145-
_doc_read_csv_and_table = (
146-
r"""
145+
_doc_read_csv_and_table = r"""
147146
{summary}
148147
149148
Also supports optionally iterating or breaking of the file
@@ -272,9 +271,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
272271
na_values : Hashable, Iterable of Hashable or dict of {{Hashable : Iterable}}, optional
273272
Additional strings to recognize as ``NA``/``NaN``. If ``dict`` passed, specific
274273
per-column ``NA`` values. By default the following values are interpreted as
275-
``NaN``: " """
276-
+ fill('", "'.join(sorted(STR_NA_VALUES)), 70, subsequent_indent=" ")
277-
+ """ ".
274+
``NaN``: "{na_values_str}".
278275
279276
keep_default_na : bool, default True
280277
Whether or not to include the default ``NaN`` values when parsing the data.
@@ -545,7 +542,6 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
545542
col 3 datetime64[ns]
546543
dtype: object
547544
"""
548-
)
549545

550546

551547
class _C_Parser_Defaults(TypedDict):
@@ -756,6 +752,9 @@ def read_csv(
756752
summary="Read a comma-separated values (csv) file into DataFrame.",
757753
see_also_func_name="read_table",
758754
see_also_func_summary="Read general delimited file into DataFrame.",
755+
na_values_str=fill(
756+
'", "'.join(sorted(STR_NA_VALUES)), 70, subsequent_indent=" "
757+
),
759758
_default_sep="','",
760759
storage_options=_shared_docs["storage_options"],
761760
decompression_options=_shared_docs["decompression_options"]
@@ -888,6 +887,9 @@ def read_table(
888887
see_also_func_summary=(
889888
"Read a comma-separated values (csv) file into DataFrame."
890889
),
890+
na_values_str=fill(
891+
'", "'.join(sorted(STR_NA_VALUES)), 70, subsequent_indent=" "
892+
),
891893
_default_sep=r"'\\t' (tab-stop)",
892894
storage_options=_shared_docs["storage_options"],
893895
decompression_options=_shared_docs["decompression_options"]

0 commit comments

Comments
 (0)