set_option¶
In [ ]:
set_option(option: str,
value: Union[bool, int, str] = None)
Sets options for VerticaPy.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
option | list | ❌ | Option to use.
|
value | object | ✓ | The new option value. |
Example¶
In [1]:
from verticapy.datasets import load_titanic
from verticapy import set_option
titanic = load_titanic()
display(titanic)
In [2]:
# Computes and displays the total number of elements
set_option("count_on", True)
titanic
Out[2]:
In [3]:
# Turns off the footer
set_option("footer_on", False)
titanic
Out[3]:
In [4]:
# Enables interactive tables
set_option("interactive", True)
titanic
Out[4]:
In [5]:
# Disables interactive tables
set_option("interactive", False)
titanic
Out[5]:
In [6]:
# Sets the maximum number of columns to display
set_option("max_columns", 3)
titanic
Out[6]:
In [7]:
# Sets the maximum number of rows to display
set_option("max_rows", 5)
titanic
Out[7]:
In [8]:
# Light mode
set_option("mode", "light")
titanic
Out[8]:
In [9]:
# Full mode
set_option("mode", "full")
titanic
Out[9]:
In [10]:
# Display the loading bar
set_option("percent_bar", True)
titanic
Out[10]:
In [11]:
# Display queries and their execution times
set_option("sql_on", True)
set_option("time_on", True)
titanic.corr()
Out[11]:
In [12]:
# Hide queries and their execution times
set_option("sql_on", False)
set_option("time_on", False)
In [13]:
# Set a seed for the random number generator
set_option("random_state", 2)
In [14]:
# Seed the random state
titanic.sample(0.1).shape()
Out[14]:
In [15]:
titanic.sample(0.1).shape()
Out[15]:
In [23]:
# Set graphic colors
set_option("color_style", "retro")
titanic.hist(["pclass", "survived"])
Out[23]:
In [24]:
# Change graphic colors
set_option("colors", ["blue", "red"])
titanic.hist(["pclass", "survived"])
Out[24]:
In [18]:
# Chang the temporary schema
set_option("temp_schema", "public")
