vDataFrame.hexbin¶
In [ ]:
vDataFrame.hexbin(columns: list,
method: str = "count",
of: str = "",
bbox: list = [],
img: str = "",
ax=None,
**style_kwds,)
Draws the hexbin plot of the input vcolumns based on an aggregation.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
| columns | list | ❌ | List of the vcolums. The list must have one or two elements. |
method | str | ✓ | One of the following methods used to aggregate the data.
|
of | str | ✓ | The vcolumn to use to compute the aggregation. |
bbox | list | ✓ | List of 4 elements to delimit the boundaries of the final Plot. It must be similar the following list: [xmin, xmax, ymin, ymax] |
img | str | ✓ | Path to the image to display as background. |
ax | Matplotlib axes object | ✓ | The axes to plot on. |
**style_kwds | any | ✓ | Any optional parameter to pass to the Matplotlib functions. |
In [1]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic)
In [3]:
titanic.hexbin(["age", "fare"])
Out[3]:
In [4]:
# Avg of survived partitioned by fare, age
titanic.hexbin(["age", "fare"], method = "avg", of = "survived")
Out[4]:
In [5]:
from verticapy import *
from verticapy.datasets import load_world
# Africa Dataset
africa = vDataFrame("africa_education")
africa_world = load_world()
africa_world = africa_world[africa_world["continent"] == "Africa"]
ax = africa_world["geometry"].geo_plot(color = "white",
edgecolor='black',)
# displaying schools in Africa
africa.hexbin(["lon", "lat"],
method = "avg",
of = "zralocp",
ax = ax)
Out[5]:
See Also¶
| vDataFrame.pivot_table | Draws the Pivot Table of vcolumns based on an aggregation. |
