Skip to content

Commit c0b7210

Browse files
committed
Add See Also and Example
1 parent 18f5552 commit c0b7210

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

pandas/io/parsers.py

+22-6
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,23 @@
299299
If a filepath is provided for `filepath_or_buffer`, map the file object
300300
directly onto memory and access the data directly from there. Using this
301301
option can improve performance because there is no longer any I/O overhead.
302-
float_precision : str, default None
302+
float_precision : str, optional
303303
Specifies which converter the C engine should use for floating-point
304304
values. The options are `None` for the ordinary converter,
305305
`high` for the high-precision converter, and `round_trip` for the
306306
round-trip converter.
307307
308308
Returns
309309
-------
310-
result : DataFrame or TextParser"""
310+
DataFrame or TextParser
311+
312+
See Also
313+
--------
314+
%s
315+
316+
Examples
317+
--------
318+
%s # doctest: +SKI"""
311319

312320
# engine is not used in read_fwf() so is factored out of the shared docstring
313321
_engine_doc = """engine : {'c', 'python'}, optional
@@ -323,14 +331,20 @@
323331
will also force the use of the Python parsing engine. Note that regex
324332
delimiters are prone to ignoring quoted data. Regex example: ``'\r\t'``.
325333
delimiter : str, default ``None``
326-
Alternative argument name for sep.
334+
Alias for sep.
327335
"""
328336

337+
_see_also = ("to_csv : Write DataFrame to "
338+
"a comma-separated values (csv) file.")
339+
340+
_example_doc = "pd.{_api}('/tmp/data.csv')"
341+
329342
_read_csv_doc = """
330343
Read CSV (comma-separated) file into DataFrame.
331344
332345
%s
333-
""" % (_parser_params % (_sep_doc.format(default="','"), _engine_doc))
346+
""" % (_parser_params % (_sep_doc.format(default="','"), _engine_doc,
347+
_see_also, _example_doc.format(_api='read_csv')))
334348

335349
_read_table_doc = """
336350
Read general delimited file into DataFrame.
@@ -340,7 +354,8 @@
340354
341355
%s
342356
""" % (_parser_params % (_sep_doc.format(default="\\t (tab-stop)"),
343-
_engine_doc))
357+
_engine_doc, _see_also,
358+
_example_doc.format(_api='read_table')))
344359

345360
_fwf_widths = """\
346361
colspecs : list of pairs (int, int) or 'infer'. optional
@@ -362,7 +377,8 @@
362377
Read a table of fixed-width formatted lines into DataFrame.
363378
364379
%s
365-
""" % (_parser_params % (_fwf_widths, ''))
380+
""" % (_parser_params % (_fwf_widths, '', _see_also,
381+
_example_doc.format(_api='read_fwf')))
366382

367383

368384
def _validate_integer(name, val, min_val=0):

0 commit comments

Comments
 (0)