# new env:
conda create --name myenv python=3.7 ipykernel numpy pandas
# remove:
conda remove --name myenv --all
# export:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # code accompanying answer: https://stats.stackexchange.com/a/471245/35989 | |
| n <- 22 | |
| x <- 13 | |
| lik <- function(p) dbinom(x, n, p) * 20 | |
| prior <- function(p) dbeta(p, alpha, beta) | |
| post <- function(p) dbeta(p, alpha+x, beta+(n-x)) | |
| op <- par(mfrow=c(1,3), mar=c(3,1,1,1), cex=0.9) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| git fetch | |
| BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| NEWBRANCH="$BRANCH-pr" | |
| if [[ -n $(git rev-parse --verify $NEWBRANCH) ]]; then | |
| read -p "'$NEWBRANCH' exists, do you want to overwrite it? (y/[n])? " CONTINUE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import scipy.stats as sp | |
| C = np.array([ | |
| [3, 2, 3], | |
| [2, 4, 2], | |
| [3, 2, 3] | |
| ]) | |
| n = 100_000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This is a pure python implementation of t-digest algorithm 1. Parts of the code are borrowed | |
| from https://github.com/CamDavidsonPilon/tdigest | |
| Code is released under The MIT License (MIT). | |
| """ | |
| import math | |
| from typing import List, Tuple, Union, Optional |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| class ECDF: | |
| def __init__(self, arr: np.ndarray, max_points: Optional[int] = None) -> None: | |
| self.arr = np.sort(arr) | |
| n = len(self.arr) | |
| if max_points and n > max_points: | |
| self.arr = self.arr[:: (n // max_points)] |