This file contains hidden or 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
newmapping_dict = {} | |
with open('modeled_interactions.dat','r') as infile: | |
for line in infile: | |
line = line.strip('\n') | |
print line | |
pdbid, sites = line.split(':') | |
print pdbid | |
print sites.split() | |
newmapping_dict[pdbid.upper()] = sites.split() | |
This file contains hidden or 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 python | |
# coding: utf-8 | |
""" | |
Summary Stats for Water Work Orders | |
Description | |
----------- | |
Python Script for producing figures and tables | |
for summary stats of Water Work Orders. | |
Figures are stored in **./figure** directory | |
and tables are stored in **./tables** directory. |
This file contains hidden or 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
drop table if exists public.main_street_map; | |
select ogc_fid, street_geom, name, type, globalid, water_geom, distance into public.main_street_map | |
from | |
( | |
select ogc_fid, street_geom, name, type, globalid, water_geom,distance, | |
row_number() over(partition by ogc_fid order by distance) rank from | |
( | |
select st_distance(s.wkb_geometry, m.wkb_geometry) distance, | |
s.ogc_fid, | |
s.wkb_geometry street_geom, |
This file contains hidden or 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
drop table if exists public.test_snap; | |
select st_closestpoint(wkb_geometry, geom) snapped_geom, geom, wkb_geometry, main_globalid, date, wrkid | |
into public.test_snap --call this something better then test_snap | |
from | |
( | |
select geom, wkb_geometry, globalid main_globalid, date, wrkid, row_number() over(partition by wrkid order by distance) rank | |
from | |
( | |
select st_distance(w.geom, m.wkb_geometry) distance, w.geom, m.wkb_geometry, m.globalid, | |
w.objectid wrkid, w.date |
This file contains hidden or 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
---------------------------------------------------- | |
--This script does the following | |
-- -creates a proto type table | |
-- - creates a table for testing main to road snapping | |
-- - creates a table for static features | |
-- - need to map soil features | |
---------------------------------------------------- | |
This file contains hidden or 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
#YAML file containing the configuration | |
#of the models. | |
#DATE STARTS AT THE END OF THE YEAR E.G. DEC 31, 2013 | |
features_table: 'features.combined' | |
break_window: '1Year' | |
static_features: ['diameters','pipe_age'] | |
past_cols: ['wo_curr', 'wo_last1', 'wo_last2', 'wo_last3', 'wo_last4', 'wo_last5'] | |
future_cols: ['wo_next1','wo_next2','wo_next3'] |
This file contains hidden or 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 time | |
time.time() | |
timestamp = time.time() | |
import datetime | |
print datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S') |
This file contains hidden or 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
syracuse=> select model_id, model_name, precision_at_1, rebalancing from model.results_stats where model_name = 'LR' order by 3 desc; | |
model_id | model_name | precision_at_1 | rebalancing | |
-------------------+------------+-------------------+------------------------------------------------------------------------------------- | |
1471389247.579113 | LR | 0.528301886792453 | none | |
1471389270.931672 | LR | 0.509433962264151 | none | |
1471389258.090024 | LR | 0.490566037735849 | none | |
1471389218.293982 | LR | 0.490566037735849 | none | |
1471389232.568056 | LR | 0.452830188679245 | none | |
1471403347.084602 | LR | 0.194444444444444 | {"break": 0.20000000000000001, "n_points": 8820, "no_break": 0.80000000000000004} | |
1471403366.063143 | LR | 0.194444444444444 | {"break": 0.10000000000000001, "n_points": 17640, "no_break": 0.90000000000000002} |
This file contains hidden or 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
!/bin/bash | |
wget https://github.com/avishekrk/where_not_to_eat/archive/master.zip; | |
unzip master.zip; | |
rm -v master.zip | |
mv -v where_not_to_eat-master raw | |
cd ./raw/ | |
pwd | |
find -name "* *" | while read f; do echo ${f}; new=$(echo $f | sed "s/ /_/g"); echo ${new}; mv -v "$f" $new; done | |
mkdir -v ./../staging | |
head -1 food_inspection_2018-01-01.csv| tr '[:upper:]' '[:lower:]' | sed -e "s/#//g" -e "s/ ,/,/g" -e "s/ /_/g" -e s"/^,//g" > header |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.