Skip to content

Commit

Permalink
Add See Also and Example
Browse files Browse the repository at this point in the history
  • Loading branch information
thoo committed Nov 10, 2018
1 parent 18f5552 commit c0b7210
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,23 @@
If a filepath is provided for `filepath_or_buffer`, map the file object
directly onto memory and access the data directly from there. Using this
option can improve performance because there is no longer any I/O overhead.
float_precision : str, default None
float_precision : str, optional
Specifies which converter the C engine should use for floating-point
values. The options are `None` for the ordinary converter,
`high` for the high-precision converter, and `round_trip` for the
round-trip converter.
Returns
-------
result : DataFrame or TextParser"""
DataFrame or TextParser
See Also
--------
%s
Examples
--------
%s # doctest: +SKI"""

# engine is not used in read_fwf() so is factored out of the shared docstring
_engine_doc = """engine : {'c', 'python'}, optional
Expand All @@ -323,14 +331,20 @@
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.
Alias for sep.
"""

_see_also = ("to_csv : Write DataFrame to "
"a comma-separated values (csv) file.")

_example_doc = "pd.{_api}('/tmp/data.csv')"

_read_csv_doc = """
Read CSV (comma-separated) file into DataFrame.
%s
""" % (_parser_params % (_sep_doc.format(default="','"), _engine_doc))
""" % (_parser_params % (_sep_doc.format(default="','"), _engine_doc,
_see_also, _example_doc.format(_api='read_csv')))

_read_table_doc = """
Read general delimited file into DataFrame.
Expand All @@ -340,7 +354,8 @@
%s
""" % (_parser_params % (_sep_doc.format(default="\\t (tab-stop)"),
_engine_doc))
_engine_doc, _see_also,
_example_doc.format(_api='read_table')))

_fwf_widths = """\
colspecs : list of pairs (int, int) or 'infer'. optional
Expand All @@ -362,7 +377,8 @@
Read a table of fixed-width formatted lines into DataFrame.
%s
""" % (_parser_params % (_fwf_widths, ''))
""" % (_parser_params % (_fwf_widths, '', _see_also,
_example_doc.format(_api='read_fwf')))


def _validate_integer(name, val, min_val=0):
Expand Down

0 comments on commit c0b7210

Please sign in to comment.