Skip to content

Commit

Permalink
DOC: Typo in docs for na_values parameter in pandas.read_csv function
Browse files Browse the repository at this point in the history
…#59314  (#59318)

* fixed formatting of default na values

* bug fix

* fixing docstring formatting

* fixing formatting for quoting
  • Loading branch information
kushagr96 authored Aug 2, 2024
1 parent 7ee1091 commit d530525
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 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,7 @@ 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 @@ -544,8 +539,7 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
col 2 datetime64[ns]
col 3 datetime64[ns]
dtype: object
"""
)
""" # noqa: E501


class _C_Parser_Defaults(TypedDict):
Expand Down Expand Up @@ -756,6 +750,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 +885,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

0 comments on commit d530525

Please sign in to comment.