Skip to content

DOC: Typo in docs for na_values parameter in pandas.read_csv function #59314 #59318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions pandas/io/parsers/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
_read_shared = dict


_doc_read_csv_and_table = (
r"""
_doc_read_csv_and_table = r"""
{summary}

Also supports optionally iterating or breaking of the file
Expand Down Expand Up @@ -272,10 +271,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
na_values : Hashable, Iterable of Hashable or dict of {{Hashable : Iterable}}, optional
Additional strings to recognize as ``NA``/``NaN``. If ``dict`` passed, specific
per-column ``NA`` values. By default the following values are interpreted as
``NaN``: " """
+ fill('", "'.join(sorted(STR_NA_VALUES)), 70, subsequent_indent=" ")
+ """ ".

``NaN``: "{na_values_str}".
keep_default_na : bool, default True
Whether or not to include the default ``NaN`` values when parsing the data.
Depending on whether ``na_values`` is passed in, the behavior is as follows:
Expand Down Expand Up @@ -357,8 +353,8 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
quotechar : str (length 1), optional
Character used to denote the start and end of a quoted item. Quoted
items can include the ``delimiter`` and it will be ignored.
quoting : {{0 or csv.QUOTE_MINIMAL, 1 or csv.QUOTE_ALL, 2 or csv.QUOTE_NONNUMERIC, \
3 or csv.QUOTE_NONE}}, default csv.QUOTE_MINIMAL
quoting : {{0 or csv.QUOTE_MINIMAL, 1 or csv.QUOTE_ALL, 2 or csv.QUOTE_NONNUMERIC,
3 or csv.QUOTE_NONE}}, default csv.QUOTE_MINIMAL
Control field quoting behavior per ``csv.QUOTE_*`` constants. Default is
``csv.QUOTE_MINIMAL`` (i.e., 0) which implies that only fields containing special
characters are quoted (e.g., characters defined in ``quotechar``, ``delimiter``,
Expand Down Expand Up @@ -545,7 +541,6 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
col 3 datetime64[ns]
dtype: object
"""
)


class _C_Parser_Defaults(TypedDict):
Expand Down Expand Up @@ -756,6 +751,9 @@ def read_csv(
summary="Read a comma-separated values (csv) file into DataFrame.",
see_also_func_name="read_table",
see_also_func_summary="Read general delimited file into DataFrame.",
na_values_str=fill(
'", "'.join(sorted(STR_NA_VALUES)), 70, subsequent_indent=" "
),
_default_sep="','",
storage_options=_shared_docs["storage_options"],
decompression_options=_shared_docs["decompression_options"]
Expand Down Expand Up @@ -888,6 +886,9 @@ def read_table(
see_also_func_summary=(
"Read a comma-separated values (csv) file into DataFrame."
),
na_values_str=fill(
'", "'.join(sorted(STR_NA_VALUES)), 70, subsequent_indent=" "
),
_default_sep=r"'\\t' (tab-stop)",
storage_options=_shared_docs["storage_options"],
decompression_options=_shared_docs["decompression_options"]
Expand Down
Loading