vDataFrame[].hist¶
In [ ]:
vDataFrame[].hist(method: str = "density",
of: str = "",
max_cardinality: int = 6,
nbins: int = 0,
h: float = 0,
color: str = '#FE5016',
ax=None,
**style_kwds,)
Draws the histogram of the vcolumn based on an aggregation.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
method | str | ✓ | One of the following methods used to aggregate the data.
|
of | str | ✓ | The vcolumn to use to compute the aggregation. |
max_cardinality | int | ✓ | Maximum number of the vcolumn distinct elements to be used as categorical (No h will be picked or computed) |
nbins | int | ✓ | Number of bins. If empty, an optimized number of bins will be computed. |
h | float | ✓ | Interval width of the bar. If empty, an optimized h will be computed. |
color | str | ✓ | Histogram color. |
ax | Matplotlib axes object | ✓ | The axes to plot on. |
**style_kwds | any | ✓ | Any optional parameter to pass to the Matplotlib functions. |
In [13]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic)
In [14]:
titanic["age"].hist()
Out[14]:
In [15]:
# 5 bins
titanic["age"].hist(nbins = 5)
Out[15]:
In [16]:
# interval of 10 years
titanic["age"].hist(h = 10)
Out[16]:
In [17]:
# avg survived partitioned by age
titanic["age"].hist(method = "avg", of = "survived")
Out[17]:
See Also¶
| vDataFrame[].bar | Draws the Bar Chart of vcolumn based on an aggregation. |
