Skip to content

Commit e3d1b0e

Browse files
Merge pull request #9588 from jorisvandenbossche/doc-sniffer
DOC: update tutorial docs on changed sniffing feature of read_csv
2 parents f71d811 + 4ecc2ac commit e3d1b0e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/source/io.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ They can take a number of arguments:
8282
(including http, ftp, and S3 locations), or any object with a ``read``
8383
method (such as an open file or ``StringIO``).
8484
- ``sep`` or ``delimiter``: A delimiter / separator to split fields
85-
on. `read_csv` is capable of inferring the delimiter automatically in some
86-
cases by "sniffing." The separator may be specified as a regular
87-
expression; for instance you may use '\|\\s*' to indicate a pipe plus
88-
arbitrary whitespace.
85+
on. With ``sep=None``, ``read_csv`` will try to infer the delimiter
86+
automatically in some cases by "sniffing".
87+
The separator may be specified as a regular expression; for instance
88+
you may use '\|\\s*' to indicate a pipe plus arbitrary whitespace.
8989
- ``delim_whitespace``: Parse whitespace-delimited (spaces or tabs) file
9090
(much faster than using a regular expression)
9191
- ``compression``: decompress ``'gzip'`` and ``'bz2'`` formats on the fly.
@@ -1085,8 +1085,8 @@ Automatically "sniffing" the delimiter
10851085
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10861086

10871087
``read_csv`` is capable of inferring delimited (not necessarily
1088-
comma-separated) files. YMMV, as pandas uses the :class:`python:csv.Sniffer`
1089-
class of the csv module.
1088+
comma-separated) files, as pandas uses the :class:`python:csv.Sniffer`
1089+
class of the csv module. For this, you have to specify ``sep=None``.
10901090

10911091
.. ipython:: python
10921092
:suppress:
@@ -1098,7 +1098,7 @@ class of the csv module.
10981098
.. ipython:: python
10991099
11001100
print(open('tmp2.sv').read())
1101-
pd.read_csv('tmp2.sv')
1101+
pd.read_csv('tmp2.sv', sep=None)
11021102
11031103
.. _io.chunking:
11041104

0 commit comments

Comments
 (0)