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
library(tidyverse) | |
library(gganimate) | |
# Setup | |
options(gganimate.nframes = 200) | |
set.seed(2019) | |
simulation <- tibble(roll = 1:10000) %>% | |
mutate(result = sample(6, n(), replace = TRUE)) %>% | |
crossing(nrolls = seq(10, 10000, 10)) %>% |
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 numby as np | |
# import your csv file into a pandas dataframe | |
df = pd.DataFrame('YOUR_FILE.csv') | |
# convert the column with the date to a date format | |
date = pd.to_datetime(df.date_column) | |
# Change the format of the date |
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
def get_unique_tracker_list(dataframe): | |
"""This function looks for unique string values in a dataframe.""" | |
mylist = list(pd.Series(dataframe.values.ravel()).unique()) | |
# Convert every element to a string. | |
templist = map(str, mylist) | |
# Return only the strings and deal with the floats. | |
mynewlist = [s for s in templist if s.replace(".", "", 1).isdigit() == False] |
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 numpy as np | |
import csv | |
file = "YOUR_FILE_PATH" | |
# Read the csv with python | |
lines=list(csv.reader(open(file))) | |
# Get the name of the 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
dayone://post?entry=My Daily Review | |
|Daily Review|| | |
|:---|:---| | |
|Summary|[prompt: Today's one word summary]| | |
|Did I work?|[list: Did I work today?|Yes|No]| | |
|Did I relax?|[list: Did I relax today?|Yes|No]| | |
|Physical Exercise|[list: Did I workout today?|Yes|No]| | |
|Satisfaction|[list: Am I happy with what I did today?|Yes|No]| | |
|Goals|[list:Any progress toward my goals?|Yes|No]| |
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 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
# Importing the libraries | |
from scipy.stats.stats import pearsonr | |
import pandas as pd | |
import numpy as np | |
import json | |
data = pd.read_csv("../../Downloads/data_books.csv", sep = ",", header=None, | |
names=['Reviewer', 'Book', 'Rating']) | |
# Picking 2 books |
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
yh = Yhat("YHAT_USERNAME", "YHAT_APIKEY") | |
yh.deploy("NYTimesClassifier", myModel) | |
# Once everything is uploaded you should see the following message | |
uploading... done! | |
{u'modelname': u'NYTimesClassifier', u'status': u'success', u'version': 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
Heroku create | |
git push heroku master | |
# Wait for the application to upload on heroku | |
heroku config:set YHAT_USERNAME=your_yhat_username | |
heroku config:set YHAT_APIKEY=your_yhat_api_key |
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
NewerOlder