Skip to content

Commit 5740668

Browse files
author
y-p
committed
CLN: add deprecation warning to set_printoptions, reset_printoptions
1 parent 747039b commit 5740668

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/source/v0.10.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ API changes
122122
- ``reset_option`` - reset one or more options to their default value. Partial names are accepted.
123123
- ``describe_option`` - print a description of one or more options. When called with no arguments. print all registered options.
124124

125-
Note: ``set_printoptions`` is now deprecated (but functioning), the print options now live under "print_config.XYZ". For example:
125+
Note: ``set_printoptions``/ ``reset_printoptions`` are now deprecated (but functioning), the print options now live under "print_config.XYZ". For example:
126126

127127

128128
.. ipython:: python

pandas/core/format.py

+6
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,9 @@ def set_printoptions(precision=None, column_space=None, max_rows=None,
12011201
Default True, "sparsify" MultiIndex display (don't display repeated
12021202
elements in outer levels within groups)
12031203
"""
1204+
import warnings
1205+
warnings.warn("set_printoptions is deprecated, use set_option instead",
1206+
FutureWarning)
12041207
if precision is not None:
12051208
set_option("print_config.precision", precision)
12061209
if column_space is not None:
@@ -1227,6 +1230,9 @@ def set_printoptions(precision=None, column_space=None, max_rows=None,
12271230
set_option("print_config.encoding", encoding)
12281231

12291232
def reset_printoptions():
1233+
import warnings
1234+
warnings.warn("reset_printoptions is deprecated, use reset_option instead",
1235+
FutureWarning)
12301236
reset_option("^print_config\.")
12311237

12321238
def detect_console_encoding():

0 commit comments

Comments
 (0)