Skip to content

Commit 29fec0a

Browse files
committed
DOC: Explain differences further for sep parameter
[ci skip]
1 parent c577c19 commit 29fec0a

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Diff for: doc/source/io.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ filepath_or_buffer : various
9191
locations), or any object with a ``read()`` method (such as an open file or
9292
:class:`~python:io.StringIO`).
9393
sep : str, defaults to ``','`` for :func:`read_csv`, ``\t`` for :func:`read_table`
94-
Delimiter to use. If sep is ``None``,
95-
will try to automatically determine this. Separators longer than 1 character
96-
and different from ``'\s+'`` will be interpreted as regular expressions, will
97-
force use of the python parsing engine and will ignore quotes in the data.
98-
Regex example: ``'\\r\\t'``.
94+
Delimiter to use. If sep is ``None``, the C engine cannot automatically detect
95+
the separator, but the Python parsing engine can, meaning the latter will be
96+
used automatically. In addition, separators longer than 1 character and
97+
different from ``'\s+'`` will be interpreted as regular expressions and
98+
will also force the use of the Python parsing engine. Note that regex
99+
delimiters are prone to ignoring quoted data. Regex example: ``'\\r\\t'``.
99100
delimiter : str, default ``None``
100101
Alternative argument name for sep.
101102
delim_whitespace : boolean, default False

Diff for: pandas/io/parsers.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,12 @@
305305
currently more feature-complete."""
306306

307307
_sep_doc = r"""sep : str, default {default}
308-
Delimiter to use. If sep is None, will try to automatically determine
309-
this. Separators longer than 1 character and different from ``'\s+'`` will
310-
be interpreted as regular expressions, will force use of the python parsing
311-
engine and will ignore quotes in the data. Regex example: ``'\r\t'``"""
308+
Delimiter to use. If sep is None, the C engine cannot automatically detect
309+
the separator, but the Python parsing engine can, meaning the latter will
310+
be used automatically. In addition, separators longer than 1 character and
311+
different from ``'\s+'`` will be interpreted as regular expressions and
312+
will also force the use of the Python parsing engine. Note that regex
313+
delimiters are prone to ignoring quoted data. Regex example: ``'\r\t'``"""
312314

313315
_read_csv_doc = """
314316
Read CSV (comma-separated) file into DataFrame

0 commit comments

Comments
 (0)