Back to Seaborn

Objects.Est

doc/_docstrings/objects.Est.ipynb

0.13.2590 B
Original Source
python
import seaborn.objects as so
from seaborn import load_dataset
diamonds = load_dataset("diamonds")
python
p = so.Plot(diamonds, "clarity", "carat")
p.add(so.Range(), so.Est())
python
p.add(so.Range(), so.Est("median"))
python
p.add(so.Range(), so.Est(errorbar="se"))
python
p.add(so.Range(), so.Est(errorbar="sd"))
python
p.add(so.Range(), so.Est(seed=0))

To compute a weighted estimate (and confidence interval), assign a weight variable in the layer where you use the stat:

python
p.add(so.Range(), so.Est(), weight="price")