Skip to content

Instantly share code, notes, and snippets.

View main.js
'use strict';
;( function ( document, window, index )
var inputs = document.querySelectorAll( '.inputfile' ); inputs, function( input )
var label = input.nextElementSibling,
labelVal = label.innerHTML;
from PIL import Image
import numpy as np
img ='10195.jpg'
img = img.resize((100,100))    
arr = np.array(img) #save this 
Image.fromarray(arr) #Check to see if you can get the image back from array
View Podcasts.txt
Python Podcasts -
Machine Learning Podcasts -
View Hackerrank_python_xml1
#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
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
#!/usr/bin/env bash
#Code adapted from (Modified to Python3.5)
cd ~
bash -b
echo 'PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> .bashrc
. .bashrc