Skip to content

Commit 4823492

Browse files
authored
DOC: parameterize "See Also" content in read_table and read_csv so that only the other function appears (#53848)
* parameterize the "see also" function for read_csv and read_table docstrings to always show the other * fix long line formatting issue
1 parent 62fb061 commit 4823492

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/io/parsers/readers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
See Also
428428
--------
429429
DataFrame.to_csv : Write DataFrame to a comma-separated values (csv) file.
430-
read_csv : Read a comma-separated values (csv) file into DataFrame.
430+
{see_also_func_name} : {see_also_func_summary}
431431
read_fwf : Read a table of fixed-width formatted lines into DataFrame.
432432
433433
Examples
@@ -839,6 +839,8 @@ def read_csv(
839839
_doc_read_csv_and_table.format(
840840
func_name="read_csv",
841841
summary="Read a comma-separated values (csv) file into DataFrame.",
842+
see_also_func_name="read_table",
843+
see_also_func_summary="Read general delimited file into DataFrame.",
842844
_default_sep="','",
843845
storage_options=_shared_docs["storage_options"],
844846
decompression_options=_shared_docs["decompression_options"]
@@ -1168,6 +1170,10 @@ def read_table(
11681170
_doc_read_csv_and_table.format(
11691171
func_name="read_table",
11701172
summary="Read general delimited file into DataFrame.",
1173+
see_also_func_name="read_csv",
1174+
see_also_func_summary=(
1175+
"Read a comma-separated values (csv) file into DataFrame."
1176+
),
11711177
_default_sep=r"'\\t' (tab-stop)",
11721178
storage_options=_shared_docs["storage_options"],
11731179
decompression_options=_shared_docs["decompression_options"]

0 commit comments

Comments
 (0)