@@ -200,8 +200,8 @@ def set_option(*args) -> None:
200
200
Parameters
201
201
----------
202
202
*args : str | object | dict
203
- Arguments provided in pairs , which will be interpreted as (pattern, value)
204
- pairs, or as a single dictionary containing multiple option-value pairs.
203
+ Arguments provided in a pair , which will be interpreted as (pattern, value),
204
+ or as a single dictionary containing multiple option-value pairs.
205
205
pattern: str
206
206
Regexp which should match a single option
207
207
value: object
@@ -239,6 +239,8 @@ def set_option(*args) -> None:
239
239
240
240
Examples
241
241
--------
242
+ Option-Value Pair Input:
243
+
242
244
>>> pd.set_option("display.max_columns", 4)
243
245
>>> df = pd.DataFrame([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
244
246
>>> df
@@ -247,6 +249,18 @@ def set_option(*args) -> None:
247
249
1 6 7 ... 9 10
248
250
[2 rows x 5 columns]
249
251
>>> pd.reset_option("display.max_columns")
252
+
253
+ Dictionary Input:
254
+
255
+ >>> pd.set_option({"display.max_columns": 4, "display.precision", 1})
256
+ >>> df = pd.DataFrame([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
257
+ >>> df
258
+ 0 1 ... 3 4
259
+ 0 1 2 ... 4 5
260
+ 1 6 7 ... 9 10
261
+ [2 rows x 5 columns]
262
+ >>> pd.reset_option("display.max_columns")
263
+ >>> pd.reset_option("display.precision")
250
264
"""
251
265
# Handle dictionary input
252
266
if len (args ) == 1 and isinstance (args [0 ], dict ):
0 commit comments