Skip to content

Commit 4f41cd0

Browse files
committed
DEPR: pd.read_table
- pd.read_table is deprecated and replaced by pd.read_csv. - added whatsnew note
1 parent 537b65c commit 4f41cd0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

doc/source/whatsnew/v0.24.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ Deprecations
319319
- :meth:`DataFrame.to_stata`, :meth:`read_stata`, :class:`StataReader` and :class:`StataWriter` have deprecated the ``encoding`` argument. The encoding of a Stata dta file is determined by the file type and cannot be changed (:issue:`21244`).
320320
- :meth:`MultiIndex.to_hierarchical` is deprecated and will be removed in a future version (:issue:`21613`)
321321
- :meth:`Series.ptp` is deprecated. Use ``numpy.ptp`` instead (:issue:`21614`)
322+
- :func:`pandas.read_table` is deprecated. Use ``pandas.read_csv`` instead (:issue:`21948`)
322323
-
323324

324325
.. _whatsnew_0240.prior_deprecations:

pandas/io/parsers.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@
326326
""" % (_parser_params % (_sep_doc.format(default="','"), _engine_doc))
327327

328328
_read_table_doc = """
329+
330+
.. deprecated:: 0.24.0
331+
Use :func:`pandas.read_csv` instead, passing `sep='\t'` if necessary.
332+
329333
Read general delimited file into DataFrame
330334
331335
%s
@@ -606,6 +610,16 @@ def parser_f(filepath_or_buffer,
606610
memory_map=False,
607611
float_precision=None):
608612

613+
if name == "read_table":
614+
if sep == None and delimiter == None:
615+
warnings.warn("read_table is deprecated, use read_csv with "
616+
"sep='\\t' instead.",
617+
FutureWarning, stacklevel=2)
618+
sep = '\t'
619+
else:
620+
warnings.warn("read_table is deprecated, use read_csv instead.",
621+
FutureWarning, stacklevel=2)
622+
609623
# Alias sep -> delimiter.
610624
if delimiter is None:
611625
delimiter = sep
@@ -685,7 +699,7 @@ def parser_f(filepath_or_buffer,
685699
read_csv = _make_parser_function('read_csv', sep=',')
686700
read_csv = Appender(_read_csv_doc)(read_csv)
687701

688-
read_table = _make_parser_function('read_table', sep='\t')
702+
read_table = _make_parser_function('read_table', sep=None)
689703
read_table = Appender(_read_table_doc)(read_table)
690704

691705

0 commit comments

Comments
 (0)