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
from tweepy.streaming import StreamListener | |
from tweepy import OAuthHandler | |
from tweepy import Stream | |
import json | |
import requests | |
client_key = "TwitterConsumerKey" | |
client_secret = "TwitterConsumerSecret" | |
token = "TwitterAppAccessToken" | |
token_secret = "TwitterAppAccessTokenSecret" |
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 json | |
import requests | |
class LiveFace(): | |
# Connect To Nest Cam REST Streaming API | |
def get_stream(self, cam_url): | |
# Manipulate the response so we can detect if motion was detected | |
DATA_PREFIX = 'data: ' |
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 | |
from scipy import stats | |
data = '''Region,Alcohol,Tobacco | |
North,6.47,4.03 | |
Yorkshire,6.13,3.76 | |
Northeast,6.19,3.77 | |
East Midlands,4.89,3.34 | |
West Midlands,5.63,3.47 | |
East Anglia,4.52,2.92 |
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
# Frequency | |
import collections | |
testlist = [1, 4, 5, 6, 7, 9, 9, 9] | |
c = collections.Counter(testlist) | |
print c | |
# calculate number of instances in list |
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 scipy.stats as stats | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
loansData = pd.read_csv('https://github.com/Thinkful-Ed/curric-data-001-data-sets/raw/master/loans/loansData.csv') | |
loansData.head() | |
# Remove rows with null values |
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
from scipy import stats | |
import collections | |
# Apply collections.Counter() on # open credit lines in Loans data to get counts of observations for each # credit lines | |
# Load reduced version of Lending Club dataset | |
loansData = pd.read_csv("https://github.com/Thinkful-Ed/curric-data-001-data-sets/raw/master/loans/loansData.csv") | |
# Drop null rows | |
loansData.dropna(inplace=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
import numpy as np | |
import pandas as pd | |
import statsmodels.api as sm | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import pandas as pd | |
loansData = pd.read_csv('https://github.com/Thinkful-Ed/curric-data-001-data-sets/raw/master/loans/loansData.csv') |
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 | |
import pandas as pd | |
import statsmodels.api as sm | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
loansData = pd.read_csv('https://github.com/Thinkful-Ed/curric-data-001-data-sets/raw/master/loans/loansData.csv') | |
# Clean Interest.Rate | |
loansData['Interest.Rate'] = loansData['Interest.Rate'].map(lambda x: float(x.rstrip('%'))) |
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 collections | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import requests | |
import sqlite3 as lite | |
import time | |
from pandas.io.json import json_normalize | |
from dateutil.parser import parse | |
%matplotlib inline |
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 requests | |
import sqlite3 as lite | |
import datetime | |
api_key = 'API_KEY' | |
url = 'https://api.forecast.io/forecast/' + api_key | |
cities = { "Wamego": '39.201941,-96.304998', | |
"Grinnell": '39.127230,-100.629031', |
OlderNewer