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
## invoking pyspark as follows: ## | |
# /path/to/spark-1.2.0-bin-hadoop2.4/bin/pyspark --jars /path/to/spark-1.2.0-bin-hadoop2.4/jars/spark-cassandra-connector-assembly-1.2.0-SNAPSHOT.jar | |
# first, stop the spark context launched by pyspark to avoid the conflict | |
sc.stop() | |
from py4j.java_gateway import java_import | |
from pyspark import SparkConf | |
conf = (SparkConf() | |
.setMaster("local") |
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
""" | |
tiny script to convert a pandas data frame into a JSON object | |
""" | |
import ujson as json | |
import pandas | |
import numpy as np | |
df = pandas.DataFrame({ | |
"time" : [1,2,3,4,5], |
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
###### development tools | |
sudo apt-get install build-essential python-dev git nodejs-legacy npm gnome-tweak-tool openjdk-8-jdk | |
### Python packages | |
sudo apt-get install python-pip python-virtualenv python-numpy python-matplotlib | |
### pip packages | |
pip install django flask django-widget-tweaks django-ckeditor beautifulsoup4 requests classifier SymPy ipython |
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
{ | |
"aliases":{}, | |
"warmers":{}, | |
"mappings": { | |
"world": { | |
"properties": { | |
"capital": { | |
"properties": { | |
"district": { | |
"type": "string" |
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 pyelasticsearch import ElasticSearch | |
import pandas as pd | |
from time import time | |
root_path="/home/clemsos/Dev/mitras/" | |
raw_data_path=root_path+"data/" | |
csv_filename="week10.csv" | |
t0=time() |
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
# multiply/divide | |
df['quantity'] = df['quantity'].apply(lambda x: x*-1) | |
# round function on dataframe | |
df['quantity'] = df['quantity'].apply(lambda x: round(x, 2)) | |
# List unique values in a DataFrame column | |
# h/t @makmanalp for the updated syntax! | |
df['Column Name'].unique() |
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
'''This script goes along the blog post | |
"Building powerful image classification models using very little data" | |
from blog.keras.io. | |
It uses data that can be downloaded at: | |
https://www.kaggle.com/c/dogs-vs-cats/data | |
In our setup, we: | |
- created a data/ folder | |
- created train/ and validation/ subfolders inside data/ | |
- created cats/ and dogs/ subfolders inside train/ and validation/ | |
- put the cat pictures index 0-999 in data/train/cats |
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
'''This script goes along the blog post | |
"Building powerful image classification models using very little data" | |
from blog.keras.io. | |
It uses data that can be downloaded at: | |
https://www.kaggle.com/c/dogs-vs-cats/data | |
In our setup, we: | |
- created a data/ folder | |
- created train/ and validation/ subfolders inside data/ | |
- created cats/ and dogs/ subfolders inside train/ and validation/ | |
- put the cat pictures index 0-999 in data/train/cats |
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
'''This script goes along the blog post | |
"Building powerful image classification models using very little data" | |
from blog.keras.io. | |
It uses data that can be downloaded at: | |
https://www.kaggle.com/c/dogs-vs-cats/data | |
In our setup, we: | |
- created a data/ folder | |
- created train/ and validation/ subfolders inside data/ | |
- created cats/ and dogs/ subfolders inside train/ and validation/ | |
- put the cat pictures index 0-999 in data/train/cats |
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
################################################################################# | |
# Authors: Keiller Nogueira, Victor de Melo | |
################################################################################# | |
# nvidia-docker seems more stable now and several images are starting to adopt it (including | |
# [kaixhin](https://github.com/NVIDIA/nvidia-docker/issues/85). | |
# hence, we suggest to use it instead, as it solves a few issues with gpu passthrough. | |
# usage: it is only required when creating a container, i.e, with `run` and related arguments | |
# you're not required to provide $DOCKER_NVIDIA_DEVICES as it will find the devices itself |
OlderNewer