Skip to content

Instantly share code, notes, and snippets.

View DanielSnipes's full-sized avatar

Daniel Snipes DanielSnipes

  • Apple
  • Cupertino, CA
View GitHub Profile
def show_coefs(data, classifier_name):
cols = data.columns
coefficients = pd.concat([pd.DataFrame(cols), pd.DataFrame(np.transpose(classifier_name.coef_))], axis = 1)
coefficients.columns = ['name', 'coef']
coefficients['OR'] = np.e**coefficients['coef']
return coefficients.dropna()
@DanielSnipes
DanielSnipes / iex.py
Created November 9, 2017 20:09 — forked from zduey/iex.py
Simple Real-Time Stock Streaming with Bokeh
import io
import requests
import pandas as pd
from bokeh.models import ColumnDataSource, HoverTool, ResizeTool, SaveTool
from bokeh.models.widgets import TextInput, Button
from bokeh.plotting import figure, curdoc
from bokeh.layouts import row, widgetbox
TICKER = ""
@DanielSnipes
DanielSnipes / API.md
Created November 14, 2017 15:27 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@DanielSnipes
DanielSnipes / README.md
Created November 30, 2017 23:39 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@DanielSnipes
DanielSnipes / AWSRegionsAndAZs.md
Created November 30, 2017 23:53
List of AWS availability zones for each AWS region
AWS region code AWS region name Number of AZs AZ names
us-east-1 Virginia 4 us-east-1a, us-east-1b, us-east-1c, us-east-1e
us-west-1 N. California 2 us-west-1a, us-west-1b
us-west-2 Oregon 3 us-west-2a, us-west-2b, us-west-2c
eu-west-1 Ireland 3 eu-west-1a, eu-west-1b, eu-west-1c
eu-central-1 Frankfurt 2 eu-central-1a, eu-central-1b
ap-southeast-1 Singapore 2 ap-southeast-1a, ap-southeast-1b
ap-southeast-2 Sydney 2 ap-southeast-2a, ap-southeast-2b, ap-southeast-2c
ap-northeast-1 Tokyo 2 ap-northeast-1a, ap-nort
@DanielSnipes
DanielSnipes / lambda_handler.py
Created December 11, 2017 14:55
AWS Lambda Random Letter Add
import json
import urllib.parse
import boto3
#need these to return random string
import random
import string
print('Loading function')
@DanielSnipes
DanielSnipes / understanding-word-vectors.ipynb
Created March 2, 2018 15:15 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DanielSnipes
DanielSnipes / spark_pandas_dataframes.py
Created March 13, 2018 13:22 — forked from mvervuurt/spark_pandas_dataframes.py
Creating a PySpark DataFrame from a Pandas DataFrame
import pandas as pd
from pyspark.sql.types import *
#Create Pandas DataFrame
pd_person = pd.DataFrame({'PERSONID':'0','LASTNAME':'Doe','FIRSTNAME':'John','ADDRESS':'Museumplein','CITY':'Amsterdam'}, index=[0])
#Create PySpark DataFrame Schema
p_schema = StructType([StructField('ADDRESS',StringType(),True),StructField('CITY',StringType(),True),StructField('FIRSTNAME',StringType(),True),StructField('LASTNAME',StringType(),True),StructField('PERSONID',DecimalType(),True)])
#Create Spark DataFrame from Pandas