选项和设置#

cudf.get_option(name)

获取选项的值。

cudf.set_option(name, val)

设置选项的值。

cudf.describe_option([name])

打印选项的描述。

cudf.option_context(*args)

with 语句上下文中临时设置选项的上下文管理器。

显示选项由 Pandas 控制#

显示选项继承自 Pandas。这包括常用的选项,例如:

  • display.max_columns

  • display.max_info_rows

  • display.max_rows

  • display.max_seq_items

例如,要在 Jupyter notebook 中显示 DataFrame 或 Series 的所有行,请调用 pandas.set_option("display.max_rows", None)

另请参阅 完整的 Pandas 显示选项列表

可用选项#

您可以使用 describe_option() 获取可用选项列表及其描述。当不带参数调用时,describe_option() 将打印出所有可用选项的描述。

In [1]: import cudf

In [2]: cudf.describe_option()
default_integer_bitwidth:
	
Default bitwidth when the dtype of an integer needs to be
inferred. If set to `None`, the API will align dtype with pandas.
APIs that respect this option include:
	- cudf object constructors
	- cudf.read_csv and cudf.read_json when `dtype` is not specified.
	- APIs that require implicit conversion of cudf.RangeIndex to an
	  integer index.
	Valid values are  None, 32 or 64. Default is None.

	[Default: None] [Current: None]
default_float_bitwidth:
	
Default bitwidth when the dtype of a float needs to be
inferred. If set to `None`, the API will align dtype with pandas.
APIs that respect this option include:
	- cudf object constructors
	- cudf.read_csv and cudf.read_json when `dtype` is not specified.
	Valid values are None, 32 or 64. Default is None.

	[Default: None] [Current: None]
spill:
	
Enables spilling.
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]
copy_on_write:
	
If set to `False`, disables copy-on-write.
If set to `True`, enables copy-on-write.
Read more at: :ref:`copy-on-write-user-doc`
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]
spill_on_demand:
	
Enables spilling on demand using an RMM out-of-memory error handler.
This has no effect if spilling is disabled, see the "spill" option.
	Valid values are True or False. Default is True.

	[Default: True] [Current: True]
spill_device_limit:
	
Enforce a device memory limit in bytes.
This has no effect if spilling is disabled, see the "spill" option.
	Valid values are any positive integer or None (disabled).
	Default is None.

	[Default: None] [Current: None]
spill_stats:
	
If not 0, enables statistics at the specified level:
    0  - disabled (no overhead).
    1+ - duration and number of bytes spilled (very low overhead).
    2+ - a traceback for each time a spillable buffer is exposed
        permanently (potential high overhead).

Valid values are any positive integer.
Default is 0 (disabled).

	[Default: 0] [Current: 0]
mode.pandas_compatible:
	
If set to `False`, retains `cudf` specific behavior.
If set to `True`, enables pandas compatibility mode,
which will try to match pandas API behaviors in case of
any inconsistency.
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]
memory_profiling:
	
If set to `False`, disables memory profiling.
If set to `True`, enables memory profiling.
Read more at: :ref:`memory-profiling-user-doc`
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]
io.parquet.low_memory:
	
If set to `False`, reads entire parquet in one go.
If set to `True`, reads parquet file in chunks.
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]
io.json.low_memory:
	
If set to `False`, reads entire json in one go.
If set to `True`, reads json file in chunks.
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]
kvikio_remote_io:
	
Whether to use KvikIO's remote IO backend or not.
	WARN: this is experimental and may be removed at any time
	without warning or deprecation period.
	Set KVIKIO_NTHREADS (default is 8) to change the number of
	concurrent tcp connections, which is important for good performance.
	Valid values are True or False. Default is False.

	[Default: False] [Current: False]