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
## Download | |
from google.colab import files | |
df.to_csv('df.csv') | |
files.download('df.csv') | |
## Upload | |
from google.colab import files | |
df = files.upload() | |
## Save CSV on remotely in Colab |
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 seaborn as sns | |
import matplotlib.pyplot as plt | |
data = pd.read_csv('Stages.csv').dropna() | |
x = "Stage" | |
y = "Experimental" | |
plt.figure(figsize=(15,16)) |
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
library(data.table) | |
DM = data.table(X = 1:5 , B = c("a", letters[6:7], NA, NA), D = c("g", | |
letters[22:25]), Y = c("j", letters[6:9]) ) | |
keycols = names(DM) | |
setkeyv(DM, keycols) | |
DT = data.table(X = 1:5, B = c("a", letters[6:9]), | |
D = c("g", letters[2:5]), Y = c("j", letters[16:19])) |
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
####### GCP/GCloud VM setup running R/Python using Anaconda ######## | |
# Prepared as part of a guest lecture series in parallel programming and GCloud setup | |
# at Pepperdine University for their inaugural ML class on 3/16/2018. | |
# Rights: MIT Licence | |
## 10 easy steps: Running R/Python in the cloud | |
1) Log into GCP | |
2) Create a project (if not done already), and log into <your project> from top of screen |
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
var allDeals = document.getElementsByClassName('u-uncoloredLink js-syndicate_click'); | |
var links = [] | |
for (var i=0; i < allDeals.length; i++) { | |
links.push(allDeals[i].getAttribute('data-url')); | |
}; | |
var csvContent = "data:text/csv;charset=utf-8,"; | |
links.forEach(function(rowArray){ | |
csvContent += rowArray + "\r\n"; |
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 IPython.display import FileLinks # FileLink | |
import os | |
data = pd.DataFrame([['a', 'b'],['c', 'd'],['e','f']], columns = ['foo', 'bar']) # .values.tolist() | |
directory = 'testdata/' | |
filename = 'data2.csv' | |
pathtofile = directory + filename | |
if not os.path.exists(directory): |
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
###### Gcloud: Jupyter Notebook with GPUs from browser | |
## First Step Install GCP 16.04 LTS with 20GB and Tesla K80 NVIDIA GPU and HTTP/HTTPS | |
## From Remote shell (*need to run twice after generating keys). Can also use SSH with default user | |
gcloud compute --project <project name> ssh --zone "us-central1-a" <gce name> | |
## Install Anaconda and setup path | |
# Required upfront: Installs nano / curl / bzip2 / etc. | |
sudo -s |
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
# Adapted for python 3 | |
# https://github.com/pbharrin/pyconometrics | |
''' | |
Created on Aug 17, 2010 | |
@author: Peter Harrington | |
peter.b.harrington@gmail.com | |
''' | |
from numpy import * |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.