git clone https://github.com/caseywatts/mediawiki
heroku apps:create MYAPPNAME
echo "web: vendor/bin/heroku-hhvm-apache2" >> Procfile
curl -sS https://getcomposer.org/installer | php
php composer.phar update
# add & commit composer.lock
heroku buildpacks:add heroku/php
heroku ps:scale web=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
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body> | |
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
# A simple cheat sheet of Spark Dataframe syntax | |
# Current for Spark 1.6.1 | |
# import statements | |
#from pyspark.sql import SQLContext | |
#from pyspark.sql.types import * | |
#from pyspark.sql.functions import * | |
from pyspark.sql import functions as F | |
#SparkContext available as sc, HiveContext available as sqlContext. |