From 9264efc31145a2ba7c58c44404f659b22a150a7d Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sat, 25 Mar 2017 18:23:46 -0700 Subject: [PATCH] DOC: Explain differences further for sep parameter [ci skip] --- doc/source/io.rst | 11 ++++++----- pandas/io/parsers.py | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/source/io.rst b/doc/source/io.rst index a702efdc6aaf9..faeea9d448cf2 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -91,11 +91,12 @@ filepath_or_buffer : various locations), or any object with a ``read()`` method (such as an open file or :class:`~python:io.StringIO`). sep : str, defaults to ``','`` for :func:`read_csv`, ``\t`` for :func:`read_table` - Delimiter to use. If sep is ``None``, - will try to automatically determine this. Separators longer than 1 character - and different from ``'\s+'`` will be interpreted as regular expressions, will - force use of the python parsing engine and will ignore quotes in the data. - Regex example: ``'\\r\\t'``. + Delimiter to use. If sep is ``None``, the C engine cannot automatically detect + the separator, but the Python parsing engine can, meaning the latter will be + used automatically. In addition, separators longer than 1 character and + different from ``'\s+'`` will be interpreted as regular expressions and + will also force the use of the Python parsing engine. Note that regex + delimiters are prone to ignoring quoted data. Regex example: ``'\\r\\t'``. delimiter : str, default ``None`` Alternative argument name for sep. delim_whitespace : boolean, default False diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index f7b2d75c19304..45c62b224ef4e 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -305,10 +305,12 @@ currently more feature-complete.""" _sep_doc = r"""sep : str, default {default} - Delimiter to use. If sep is None, will try to automatically determine - this. Separators longer than 1 character and different from ``'\s+'`` will - be interpreted as regular expressions, will force use of the python parsing - engine and will ignore quotes in the data. Regex example: ``'\r\t'``""" + Delimiter to use. If sep is None, the C engine cannot automatically detect + the separator, but the Python parsing engine can, meaning the latter will + be used automatically. In addition, separators longer than 1 character and + different from ``'\s+'`` will be interpreted as regular expressions and + will also force the use of the Python parsing engine. Note that regex + delimiters are prone to ignoring quoted data. Regex example: ``'\r\t'``""" _read_csv_doc = """ Read CSV (comma-separated) file into DataFrame