this is the nav!
course notes
• AI Chat
• Code
• Report
• `.mfe-app-workspace-11z5vno{font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;font-size:13px;line-height:20px;}`# Start coding here... ``

`pd.merge_asof`

Perform a merge by key distance.

This is similar to a left-join except that we match on nearest key rather than equal keys. Both DataFrames must be sorted by the key.

variance

Measures the average distance from eatch point to the mean algo:

• for every point take distance to mean
• square distance
• sum
• devide by number of points - 1 numpy: `np.var(data, ddof=1)` ddof= 0 only for full population stats

std:

Square root of variance numpy: `np.std(data, ddof=1)`

mean absolute deviation

algo:

• take distance for each point to mean
• take absolute value for each distance
• take mean of those distances

std vs mad : std penalizes longer distances more then shorter distances (due to square) vs mad penalizes equally

quantiles:

Splits up data in some number of equal parts numpy: `np.quantile(data, quantiles)`

IQR

Distance between .25 quantile and .75 quantile = height of boxplot scipy:

```.mfe-app-workspace-16mnz0b{right:4px;top:4px;}.mfe-app-workspace-5n8jq8{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:var(--wf-text--subtle, #5D6A77);float:right;right:4px;top:4px;}.mfe-app-workspace-cfwmlx{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-color:transparent;border-radius:4px;border-style:solid;border-width:2px;cursor:pointer;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-family:Studio-Feixen-Sans,Arial,sans-serif;font-weight:800;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;line-height:1;margin:0;outline:0;padding:0;position:relative;-webkit-text-decoration:none;text-decoration:none;-webkit-transition:background-color 125ms ease-out;transition:background-color 125ms ease-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;background-color:transparent;color:var(--wf-text--link, #0065D1);font-size:12px;height:28px;min-width:28px;width:auto;padding-left:8px;padding-right:8px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:var(--wf-text--subtle, #5D6A77);float:right;right:4px;top:4px;}.mfe-app-workspace-cfwmlx::before{border-radius:2px;content:"";display:block;height:100%;inset:0;position:absolute;width:100%;z-index:0;}.mfe-app-workspace-cfwmlx:active{background-color:transparent;}.mfe-app-workspace-cfwmlx:disabled{cursor:default;opacity:0.4;pointer-events:none;}.mfe-app-workspace-cfwmlx:hover{border-color:var(--wf-bg--hover, rgba(48, 57, 105, 0.06));}.mfe-app-workspace-cfwmlx:hover::before{background-color:var(--wf-bg--hover, rgba(48, 57, 105, 0.06));}.mfe-app-workspace-cfwmlx >*{z-index:1;}.mfe-app-workspace-1hnbc48{font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;font-size:13px;line-height:20px;padding:8px;}.mfe-app-workspace-1hnbc48 code{font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;}```from scipy.stats import iqr
iqr(data)
``````

Outliers

defined as: data < Q1 - 1.5 * IQR && data > Q3 + 1.5 * IQR