This file contains 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
fs = require('fs'); | |
moment = require('moment'); | |
var dates = [] | |
fs.readFile('times.js', 'utf8', function (err,data) { | |
if (err) { | |
return console.log(err); | |
} |
This file contains 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
/** | |
* @fileoverview Rule to flag use of _.cloneDeep | |
* @author Joseph Allen | |
*/ | |
//------------------------------------------------------------------------------ | |
// Rule Definition | |
//------------------------------------------------------------------------------ | |
module.exports = function(context) { |
This file contains 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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 518, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ |
This file contains 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 | |
echo -n "GitHub User: " | |
read USER | |
echo -n "GitHub Password: " | |
read -s PASS | |
echo "" | |
echo -n "GitHub Repo (e.g. foo/bar): " |
This file contains 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 sys | |
import itertools | |
def permute(df): | |
columns = [df[column] for column in list(df)] | |
uniq_columns = [columns[x].unique() for x in range(0, len(columns))] | |
return pd.DataFrame(list(itertools.product(*uniq_columns)), |
This file contains 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
jupyter nbconvert --to pdf Report.ipynb --TemplateExporter.exclude_input=True |
This file contains 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
@pytest.fixture(params=[('input', 'expected')]) | |
def get_input(request): | |
return request.param | |
@pytest.fixture | |
def get_function_result(get_input): | |
return test_function(get_input[0]) | |
This file contains 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 matplotlib.pyplot as plt | |
import seaborn as sns | |
import pandas as pd | |
from sklearn.tree import DecisionTreeClassifier | |
def plot_histograms(df, variables, n_rows, n_cols): | |
fig = plt.figure(figsize=(16, 12)) | |
for i, var_name in enumerate(variables): | |
ax = fig.add_subplot(n_rows, n_cols, i+1) |
This file contains 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
# Ignore warnings | |
import warnings | |
warnings.filterwarnings('ignore') | |
# Handle table-like data and matrices | |
import numpy as np | |
import pandas as pd | |
# Modelling Algorithms | |
from sklearn.tree import DecisionTreeClassifier |
This file contains 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 collections import Counter | |
def detect_outliers(df, n, features): | |
""" | |
Takes a dataframe df of features and returns a list of the indices | |
corresponding to the observations containing more than n outliers according | |
to the Tukey method. | |
""" |
OlderNewer