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 IPython import embed_kernel | |
import start_notebook | |
def main(): | |
p = start_notebook.main() | |
localDict = { 'a':1, 'b':2 } | |
embed_kernel() | |
p.kill() |
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 pyspark import SparkContext, SparkConf | |
from pyspark.sql import HiveContext, SQLContext | |
import pandas as pd | |
# sc: Spark context | |
# file_name: csv file_name | |
# table_name: output table name | |
# sep: csv file separator | |
# infer_limit: pandas type inference nb rows | |
def read_csv(sc, file_name, table_name, sep=",", infer_limit=10000): |
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
## No-internet access mode | |
yum install gcc openssl-devel zlib-devel blas-devel lapack-devel gcc-c++ bzip2-devel lzo-devel freetype-devel libpng-devel sqlite-devel | |
## Python 2.7.9 installation from sources | |
cd /tmp | |
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz | |
tar -zxvf Python-2.7.9.tgz | |
cd Python-2.7.9 |
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
## Creating py4sci requirements repository - internet access required | |
cd /tmp | |
echo " | |
Theano==0.7.0 | |
cytoolz==0.7.3 | |
docopt==0.6.2 | |
gdbn==0.1 | |
gnumpy==0.2 |