MCPcopy
hub / github.com/pandas-dev/pandas / get_option

Function get_option

pandas/_config/config.py:143–191  ·  view source on GitHub ↗

Retrieve the value of the specified option. This method allows users to query the current value of a given option in the pandas configuration system. Options control various display, performance, and behavior-related settings within pandas. Parameters ---------- pat :

(pat: str)

Source from the content-addressed store, hash-verified

141
142
143def get_option(pat: str) -> Any:
144 """
145 Retrieve the value of the specified option.
146
147 This method allows users to query the current value of a given option
148 in the pandas configuration system. Options control various display,
149 performance, and behavior-related settings within pandas.
150
151 Parameters
152 ----------
153 pat : str
154 Regexp which should match a single option.
155
156 .. warning::
157
158 Partial matches are supported for convenience, but unless you use the
159 full option name (e.g. x.y.z.option_name), your code may break in future
160 versions if new options with similar names are introduced.
161
162 Returns
163 -------
164 Any
165 The value of the option.
166
167 Raises
168 ------
169 OptionError : if no such option exists
170
171 See Also
172 --------
173 set_option : Set the value of the specified option or options.
174 reset_option : Reset one or more options to their default value.
175 describe_option : Print the description for one or more registered options.
176
177 Notes
178 -----
179 For all available options, please view the :ref:`User Guide <options.available>`
180 or use ``pandas.describe_option()``.
181
182 Examples
183 --------
184 >>> pd.get_option("display.max_columns") # doctest: +SKIP
185 4
186 """
187 key = _get_single_key(pat)
188
189 # walk the nested dict
190 root, k = _get_root(key)
191 return root[k]
192
193
194def set_option(*args) -> None:

Callers 15

_get_plot_backendFunction · 0.90
pandas_convertersFunction · 0.90
nanops.pyFile · 0.90
_repr_fits_vertical_Method · 0.90
_info_reprMethod · 0.90
_repr_html_Method · 0.90
insertMethod · 0.90
__init__Method · 0.90
_repr_categoriesMethod · 0.90
_get_repr_footerMethod · 0.90
_add_offsetMethod · 0.90

Calls 2

_get_single_keyFunction · 0.85
_get_rootFunction · 0.85

Tested by 9

dfFunction · 0.72
test_wide_reprMethod · 0.72
test_wide_repr_namedMethod · 0.72
test_repr_html_longMethod · 0.72
test_repr_html_floatMethod · 0.72