mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-06-09 03:07:13 +00:00
remove mkdocs specific syntax
This commit is contained in:
parent
8d08c1964f
commit
8026e1465b
77 changed files with 1128 additions and 1128 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Basic Imports For Seaborn
|
||||
|
||||
```python linenums="1"
|
||||
```python
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
|
@ -15,7 +15,7 @@ sns.set(style='darkgrid')
|
|||
|
||||
## REPLOT (relationship)
|
||||
|
||||
```python linenums="1"
|
||||
```python
|
||||
sns.replot(x='name_in_data', y='name_in_data', hue='point_color', size='point_size', style='point_shape', data=data)
|
||||
# HUE, SIZE and STYLE: {name in data} -- used to differentiate points, a sort-of 3rd dimension
|
||||
# hue behaves differently if the data is categorical or numerical, numerical uses a color gradient
|
||||
|
@ -38,7 +38,7 @@ sns.scatterplot() # underlying axis-level function of replot()
|
|||
|
||||
Using semantics in lineplot will determine the aggregation of data.
|
||||
|
||||
```python linenums="1"
|
||||
```python
|
||||
sns.replot(ci=None, sort=bool, kind='line')
|
||||
sns.lineplot() # underlying axis-level function of replot()
|
||||
```
|
||||
|
@ -47,7 +47,7 @@ sns.lineplot() # underlying axis-level function of replot()
|
|||
|
||||
Categorical: divided into discrete groups.
|
||||
|
||||
```python linenums="1"
|
||||
```python
|
||||
sns.catplot(x='name_in_data', y='name_in_data', data=data)
|
||||
# HUE: {name in data} -- used to differenziate points, a sort-of 3rd dimension
|
||||
# COL, ROW: {name in data} -- categorical variables that will determine the grid of plots
|
||||
|
@ -68,7 +68,7 @@ sns.stripplot()
|
|||
|
||||
Adjusts the points along the categorical axis preventing overlap.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
sns.catplot(kind='swarm')
|
||||
sns.swarmplot()
|
||||
# SIZE: {float} -- Diameter of the markers, in points
|
||||
|
@ -84,7 +84,7 @@ sns.boxplot()
|
|||
|
||||
Combines a boxplot with the kernel density estimation procedure.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
sns.catplot(kind='violin')
|
||||
sns.violonplot()
|
||||
```
|
||||
|
@ -94,7 +94,7 @@ sns.violonplot()
|
|||
Plot similar to boxplot but optimized for showing more information about the shape of the distribution.
|
||||
It is best suited for larger datasets.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
sns.catplot(kind='boxen')
|
||||
sns.boxenplot()
|
||||
```
|
||||
|
@ -103,7 +103,7 @@ sns.boxenplot()
|
|||
|
||||
Show point estimates and confidence intervals using scatter plot glyphs.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
sns.catplot(kind='point')
|
||||
sns.pointplot()
|
||||
# CI: {float, sd} -- size of confidence intervals to draw around estimated values, sd -> standard deviation
|
||||
|
@ -120,7 +120,7 @@ sns.pointplot()
|
|||
|
||||
Show point estimates and confidence intervals as rectangular bars.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
sns.catplot(kind='bar')
|
||||
sns.barplot()
|
||||
# CI: {float, sd} -- size of confidence intervals to draw around estimated values, sd -> standard deviation
|
||||
|
@ -134,7 +134,7 @@ sns.barplot()
|
|||
|
||||
Show the counts of observations in each categorical bin using bars.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
sns.catplot(kind='count')
|
||||
sns.countplot()
|
||||
# DODGE: {bool} -- whether elements should be shifted along the categorical axis if hue is used
|
||||
|
@ -146,7 +146,7 @@ sns.countplot()
|
|||
|
||||
Flexibly plot a univariate distribution of observations
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
# A: {series, 1d-array, list}
|
||||
sns.distplot(a=data)
|
||||
# BINS: {None, arg for matplotlib hist()} -- specification of hist bins, or None to use Freedman-Diaconis rule
|
||||
|
@ -160,7 +160,7 @@ sns.distplot(a=data)
|
|||
|
||||
Plot datapoints in an array as sticks on an axis.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
# A: {vector} -- 1D array of observations
|
||||
sns.rugplot(a=data) # -> axes obj with plot on it
|
||||
# HEIGHT: {scalar} -- height of ticks as proportion of the axis
|
||||
|
@ -172,7 +172,7 @@ sns.rugplot(a=data) # -> axes obj with plot on it
|
|||
|
||||
Fit and plot a univariate or bivariate kernel density estimate.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
# DATA: {1D array-like} -- input data
|
||||
sns.kdeplot(data=data)
|
||||
# DATA2 {1D array-like} -- second input data. if present, a bivariate KDE will be estimated.
|
||||
|
@ -185,7 +185,7 @@ sns.kdeplot(data=data)
|
|||
|
||||
Draw a plot of two variables with bivariate and univariate graphs.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
# X, Y: {string, vector} -- data or names of variables in data
|
||||
sns.jointplot(x=data, y=data)
|
||||
# DATA:{pandas DataFrame} -- DataFrame when x and y are variable names
|
||||
|
@ -203,7 +203,7 @@ sns.jointplot(x=data, y=data)
|
|||
|
||||
Plot pairwise relationships in a dataset.
|
||||
|
||||
```py linenums="1"
|
||||
```py
|
||||
# DATA: {pandas DataFrame} -- tidy (long-form) dataframe where each column is a variable and each row is an observation
|
||||
sns.pairplot(data=pd.DataFrame)
|
||||
# HUE: {string (variable name)} -- variable in data to map plot aspects to different colors
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue