@@ -217,8 +217,8 @@ def set_option(*args) -> None:
217
217
.. warning::
218
218
219
219
Partial pattern matches are supported for convenience, but unless you
220
- use the full option name (e.g. ``x.y.z.option_name``), your code may break in
221
- future versions if new options with similar names are introduced.
220
+ use the full option name (e.g. ``x.y.z.option_name``), your code may break
221
+ in future versions if new options with similar names are introduced.
222
222
223
223
Returns
224
224
-------
@@ -239,7 +239,7 @@ def set_option(*args) -> None:
239
239
get_option : Retrieve the value of the specified option.
240
240
reset_option : Reset one or more options to their default value.
241
241
describe_option : Print the description for one or more registered options.
242
- option_context : Context manager to temporarily set options in a `` with` ` statement.
242
+ option_context : Context manager to temporarily set options in a `with` statement.
243
243
244
244
Notes
245
245
-----
@@ -271,7 +271,7 @@ def set_option(*args) -> None:
271
271
else :
272
272
if not nargs or nargs % 2 != 0 :
273
273
raise ValueError (
274
- "Must provide an even number of non-keyword arguments or a single dictionary"
274
+ "Must provide an even number of non-keyword arguments or a dictionary"
275
275
)
276
276
pairs = zip (args [::2 ], args [1 ::2 ])
277
277
@@ -286,7 +286,8 @@ def set_option(*args) -> None:
286
286
opt .cb (key )
287
287
288
288
289
- ### Second Approach Supports both *args[pd.set_option(options)] and **kwargs[pd.set_option(**options)] where options=dict
289
+ ### Second Approach Supports both *args[pd.set_option(options)]
290
+ ### and **kwargs[pd.set_option(**options)] where options=dict
290
291
291
292
292
293
# def set_option(*args, **kwargs) -> None:
@@ -301,17 +302,17 @@ def set_option(*args) -> None:
301
302
# Options can be provided in any one of the following forms:
302
303
303
304
# 1. **Dictionary as a single positional argument:**
304
- # Pass a dictionary where each key is an option pattern and its corresponding value
305
- # is the new option value.
305
+ # Pass a dictionary where each key is an option pattern and its corresponding
306
+ # value is the new option value.
306
307
307
308
# Example:
308
309
309
310
# >>> pd.set_option({"display.max_columns": 4, "display.width": 80})
310
311
311
312
# 2. **Keyword arguments or dictionary unpacking:**
312
- # Pass options as keyword arguments, where each keyword is the option name and its
313
- # corresponding value is the new option value. This also supports dictionary unpacking
314
- # using the double asterisk syntax.
313
+ # Pass options as keyword arguments, where each keyword is the option name and
314
+ # its corresponding value is the new option value. This also supports
315
+ # dictionary unpacking using the double asterisk syntax.
315
316
316
317
# Example:
317
318
@@ -320,8 +321,8 @@ def set_option(*args) -> None:
320
321
# >>> pd.set_option(**options)
321
322
322
323
# 3. **Traditional paired positional arguments:**
323
- # Provide an even number of positional arguments that are interpreted as (pattern, value)
324
- # pairs.
324
+ # Provide an even number of positional arguments that are interpreted as
325
+ # (pattern, value) pairs.
325
326
326
327
# Example:
327
328
@@ -334,9 +335,9 @@ def set_option(*args) -> None:
334
335
# - A single dictionary of options.
335
336
# - Or an even number of arguments representing (pattern, value) pairs.
336
337
# **kwargs : object
337
- # When provided, keyword arguments are treated as options where the keyword is the option
338
- # name and the value is the new option value. This includes dictionary unpacking using
339
- # the ** syntax.
338
+ # When provided, keyword arguments are treated as options where the keyword
339
+ # is the option name and the value is the new option value. This includes
340
+ # dictionary unpacking using the ** syntax.
340
341
341
342
# Returns
342
343
# -------
@@ -357,12 +358,12 @@ def set_option(*args) -> None:
357
358
# get_option : Retrieve the value of the specified option.
358
359
# reset_option : Reset one or more options to their default value.
359
360
# describe_option : Print the description for one or more registered options.
360
- # option_context : Context manager to temporarily set options in a ``with`` statement.
361
+ # option_context : Context manager to temporarily set options in a statement.
361
362
362
363
# Notes
363
364
# -----
364
- # For a complete list of available options, please refer to the :ref:`User Guide <options.available>`
365
- # or use ``pandas.describe_option()``.
365
+ # For a complete list of available options, please refer to the
366
+ # :ref:`User Guide <options.available>` or use ``pandas.describe_option()``.
366
367
367
368
# Examples
368
369
# --------
@@ -393,7 +394,7 @@ def set_option(*args) -> None:
393
394
# else:
394
395
# if not args or len(args) % 2 != 0:
395
396
# raise ValueError(
396
- # "Must provide an even number of non-keyword arguments or a single dictionary "
397
+ # "Must provide an even number of non-keyword arguments or a dict "
397
398
# )
398
399
# for key, value in zip(args[::2], args[1::2]):
399
400
# _set_single_option(key, value)
0 commit comments