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
'use strict'; | |
;( function ( document, window, index ) | |
{ | |
var inputs = document.querySelectorAll( '.inputfile' ); | |
Array.prototype.forEach.call( inputs, function( input ) | |
{ | |
var label = input.nextElementSibling, | |
labelVal = label.innerHTML; |
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 PIL import Image | |
import numpy as np | |
img = Image.open('10195.jpg') | |
img = img.resize((100,100)) | |
arr = np.array(img) #save this | |
print(arr.shape) | |
Image.fromarray(arr) #Check to see if you can get the image back from array |
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
Python Podcasts - https://dbader.org/blog/ultimate-list-of-python-podcasts | |
Machine Learning Podcasts - http://machinelearningmastery.com/machine-learning-podcasts/ |
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
#XML 1 - Find the score | |
import xml.etree.ElementTree as etree | |
N = int(input()) | |
xml = "" | |
for i in range(0,N): | |
xml = xml + str(input().strip()) | |
score = 0 |
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 | |
#Convert timedelta to number of seconds | |
td = pd.to_timedelta ("22 days 04:37:08") | |
print(td," is ",(td / np.timedelta64(1, 's')).astype(int)," seconds") | |
#Convert seconds to hh:mm:ss | |
sec = 63914 | |
print(sec, " seconds is " ,pd.to_timedelta(sec, unit='s')) | |
#difference between two dates in seconds |
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
#!/usr/bin/env bash | |
#Code adapted from https://gist.github.com/yangj1e/3641843c758201ebbc6c (Modified to Python3.5) | |
cd ~ | |
#wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.0-Linux-x86_64.sh | |
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.1-Linux-x86_64.sh | |
bash Anaconda3-2.4.1-Linux-x86_64.sh -b | |
echo 'PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> .bashrc | |
. .bashrc |