From bc320dd04dfa8449e753c5e1299371e7e9be6117 Mon Sep 17 00:00:00 2001 From: Shawn Heide Date: Sun, 24 Jul 2016 15:08:20 -0700 Subject: [PATCH] Fixes #13738: change escape format for read_csv, read_table, and to_csv in ordert to produce correct docs and docstrings --- pandas/core/frame.py | 4 ++-- pandas/io/parsers.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index fe05b3715f45d..4ffd9c5466b6c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1306,7 +1306,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, quotechar='"', line_terminator='\n', chunksize=None, tupleize_cols=False, date_format=None, doublequote=True, escapechar=None, decimal='.', **kwds): - """Write DataFrame to a comma-separated values (csv) file + r"""Write DataFrame to a comma-separated values (csv) file Parameters ---------- @@ -1343,7 +1343,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, a string representing the compression to use in the output file, allowed values are 'gzip', 'bz2', 'xz', only used when the first argument is a filename - line_terminator : string, default '\\n' + line_terminator : string, default ``'\n'`` The newline character or character sequence to use in the output file quoting : optional constant from csv module diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index f6a84ea9debaa..bedf21318aa83 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -277,11 +277,11 @@ Parser engine to use. The C engine is faster while the python engine is currently more feature-complete.""" -_sep_doc = """sep : str, default {default} +_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'""" + 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'``""" _read_csv_doc = """ Read CSV (comma-separated) file into DataFrame