I hereby claim:
- I am emesterhazy on github.
- I am emesterhazy (https://keybase.io/emesterhazy) on keybase.
- I have a public key ASAw1GnQdCu1VwTQqmDzEaZjHWJT5-yBv2VS9z5LHvKsXwo
To claim this, I am signing this object:
open Base | |
open Stdio | |
let fizzbuzz i = | |
match (i % 3, i % 5) with | |
| (0,0) -> "FizzBuzz" | |
| (0,_) -> "Fizz" | |
| (_,0) -> "Buzz" | |
| _ -> Int.to_string i |
-- Creates a calendar table in mysql | |
DROP TABLE IF EXISTS calendar; | |
CREATE TABLE calendar ( | |
id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
db_date DATE NOT NULL, | |
year INTEGER NOT NULL, | |
month INTEGER NOT NULL, -- 1 to 12 | |
day INTEGER NOT NULL, -- 1 to 31 | |
quarter INTEGER NOT NULL, -- 1 to 4 |
import sqlalchemy as sa | |
def sql_type(data_frame): | |
"""Return a dict of sql types inferred from pandas type""" | |
type_dict = {} | |
for i, j in zip(data_frame.columns, data_frame.dtypes): | |
if 'float' in str(j): | |
type_dict.update({i: sa.types.Float(precision=5, | |
asdecimal=True)}) | |
elif 'object' in str(j): |
I hereby claim:
To claim this, I am signing this object: