Skip to content

Commit 01b3b0f

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 01b3b0f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 1 addition & 0 deletions
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

Lines changed: 18 additions & 0 deletions
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
@@ -539,6 +543,9 @@ def _make_parser_function(name, sep=','):
539543

540544
default_sep = sep
541545

546+
if name == "read_table":
547+
sep = None
548+
542549
def parser_f(filepath_or_buffer,
543550
sep=sep,
544551
delimiter=None,
@@ -606,6 +613,17 @@ def parser_f(filepath_or_buffer,
606613
memory_map=False,
607614
float_precision=None):
608615

616+
if name == "read_table":
617+
if sep is None and delimiter is None:
618+
warnings.warn("read_table is deprecated, use read_csv "
619+
"with sep='\\t' instead.",
620+
FutureWarning, stacklevel=2)
621+
sep = '\t'
622+
else:
623+
warnings.warn("read_table is deprecated, use read_csv "
624+
"instead.",
625+
FutureWarning, stacklevel=2)
626+
609627
# Alias sep -> delimiter.
610628
if delimiter is None:
611629
delimiter = sep

0 commit comments

Comments
 (0)