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
x1 = np.linspace(-0.5, 1.25, num=100) | |
x2 = np.linspace(0, 2, num=100) | |
def y1(x): | |
y = -2 * x**3 + 1.5 * x ** 2 + x | |
return y[np.argmax(y <0):] | |
def y2(x): | |
return 1 / (1 + np.exp(-5 * x + 4)) |
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
-- Python function template to simulate the effects of a split test | |
-- Returns string with expected uplift and probability of Alt being better than Orig | |
-- as these are the values used to support decision making for UIUX testing | |
create function f_simulate_split_test(completions_orig INTEGER, sessions_orig INTEGER, | |
completions_alt INTEGER, sessions_alt INTEGER) | |
; | |
create function f_simulate_split_test(completions_orig INTEGER, sessions_orig INTEGER, | |
completions_alt INTEGER, sessions_alt INTEGER) | |
returns varchar(2000) |
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
# http://stackoverflow.com/questions/17490444/import-matplotlib-pyplot-hangs# | |
cd ~/.matplotlib/ | |
fc-list |
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
# http://stackoverflow.com/questions/33112020/how-do-i-install-jupyter-ipython-on-dataproc | |
PROJECT_ID=<project_id> | |
CLUSTER_NAME=<cluster_name> | |
# This should be ipython.sh | |
# https://github.com/GoogleCloudPlatform/dataproc-initialization-actions/blob/master/ipython-notebook/ipython.sh | |
INIT_GCS_SCRIPT=<init_gcs_script> | |
CHROME="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" | |
gcloud beta dataproc clusters create $CLUSTER_NAME --zone europe-west1-b \ |
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
create function f_extract_query_param(query_string VARCHAR, param VARCHAR) | |
returns varchar | |
STABLE | |
AS $$ | |
# Split on ampersand and then on =, ensuring every param has a pair | |
params = query_string.split("&") | |
# split(.., 1) because there might be multiple '=' in the param | |
kp = [p.split("=", 1) for p in params] | |
# create dict, with "" for missing values where the key is not an empty string |
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
# Based on | |
# http://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip | |
# pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U | |
pip3 list -o | cut -d ' ' -f 1 | xargs -n1 pip3 install -U |
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
brew install proj | |
brew install geos | |
# Assuming normal scipy stack is installed | |
pip3 install Pillow | |
pip3 install cartopy |