some stuff to know about deploying a function to aws lambda:
main.py should look like this:
function handler_fn(event, context):
I was trying to open some index.html
file that attempts to load in a json
file and got the following error:
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Turns out this error gets thrown in chrome if your web page isn't being served up via a proper webserver credits here
inbox do something tomorrow that i just remembered about but don't want to leave the command line
instructions in the readme
. they're easy.
import pandas as pd | |
data = [ | |
[1,2], | |
[3,4], | |
[4,5], | |
[8,9] | |
] | |
df = pd.DataFrame(data, columns=['a','b']) |
def fn(*args, **kwargs): | |
print kwargs | |
print '{a} {b}'.format(**kwargs) | |
fn(a='blah', b='asdf') |
import pandas as pd | |
data = [ | |
[1,2], | |
[3,4], | |
[5,6] | |
] | |
cols = ['a','b'] |
import arrow | |
import pprint | |
start = '2015-01-01' | |
end = '2015-01-02' | |
s = arrow.get(start) | |
e = arrow.get(end) | |
print s |
from passlib.hash import pbkdf2_sha256 | |
import time | |
passwd = 'asdf' | |
for x in range(0,20): | |
r = pow(2,x) | |
t0 = time.time() | |
h = pbkdf2_sha256.encrypt(passwd, rounds=r, salt_size=16) | |
t1 = time.time() |