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
conda list | tr -s ' ' | cut -d ' ' -f1 | uniq -c | awk '$1>1' |
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 | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.linear_model import LinearRegression | |
import skflow | |
import pytest | |
class TestLinearRegression: | |
def setup_class(self): | |
'''Simple linear model with a tiny amount of noise''' | |
rng = np.random.RandomState(67) |
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
from bs4 import BeautifulSoup as bs | |
import urllib2 | |
import re | |
import wget | |
# Where do you want to download the files? | |
path = '~/studs_terkel/%s' | |
# Page with all the mp3 links | |
url = 'http://conversations.studsterkel.org/htimes.php' |
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 pandas as pd | |
import numpy as np | |
from sklearn.metrics import confusion_matrix | |
labels = ['N', 'L', 'R', 'A', 'P', 'V'] | |
df = pd.DataFrame([ | |
[1971, 19, 1, 8, 0, 1], | |
[16, 1940, 2, 23, 9, 10], | |
[8, 3, 181, 87, 0, 11], | |
[2, 25, 159, 1786, 16, 12], |
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
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
pd.Series(np.random.normal(1,10, size=1000)).hist() | |
plt.title('Sweet') |
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
# Flatten a nested array or list | |
[item for sublist in l for item in sublist] |
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
custom_style = {'axes.labelcolor': 'white', | |
'axes.linewidth': 2, | |
'xtick.color': 'white', | |
'ytick.color': 'white', | |
'lines.color': 'white', | |
'patch.edgecolor': 'white', | |
'text.color': 'white', | |
'axes.facecolor': '#1d1f21', | |
'axes.edgecolor': 'white', | |
'axes.labelcolor': 'white', |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |