| description | filter | expression | other | coeff |
|---|---|---|---|---|
| Drive alone - Unavailable | sovAvailable==0 | -999 | ||
| Drive alone - Unavailable for zero auto households | autos==0 | 1 | -999 | |
| Drive alone - Unavailable for persons less than 16 | age<16 | 1 | -999 | |
| Drive alone - Unavailable for joint tours | tourCategoryJoint==1 | 1 | -999 | |
| Drive alone - Unavailable if didn't drive to work |
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
| from monary import Monary | |
| import numpy as np, pandas as pd | |
| import time | |
| mon = Monary() | |
| columns = ['x','y','shape_area','zone_id','county_id','parcel_id'] | |
| t1 = time.time() | |
| numpy_arrays = mon.query('bayarea','parcels',{},columns,['float32']*len(columns)) | |
| df = np.matrix(numpy_arrays).transpose() | |
| df = pd.DataFrame(df, columns=columns) | |
| print time.time()-t1 |
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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:0cf6cb9492bf54a87341cd63b1eaa77ad1a76608073d08f68c5c2d41d7568686" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:3687bfe6e588cba4b1013e657e1f62b803fc49a204d980923fc3bdb31ced8c99" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
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 pandas as pd | |
| import cPickle | |
| import sys | |
| args = sys.argv[1:] | |
| assert len(args) == 2, "go.py <infile.jar> <outfile.h5>" | |
| d = cPickle.load(open(args[0])) | |
| nodes = pd.DataFrame(d['nodes'], index=d['nodeids']) |
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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:1cb19ce6c787115025feeb23df2dc82b4547224d32a0d8f2dfc941418962d417" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
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 models | |
| import time | |
| import urbansim.sim.simulation as sim | |
| import sys | |
| print "Started", time.ctime() | |
| print "Run number", sim.get_injectable("run_number") | |
| in_year, out_year = 2010, 2040 | |
| try: |
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 pyproj | |
| import pandas as pd | |
| s = pd.HDFStore('osm_bayarea.h5', "r") | |
| s2 = pd.HDFStore('osm_bayarea4326.h5', "w") | |
| s2["edges"] = s["edges"] | |
| po = s["nodes"] | |
| print po.describe() |
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
| def make_key(row): | |
| return "cx="+(row.centroidx/10).round(0).astype('str') + \ | |
| ", cy=" + (row.centroidy/10).round(0).astype('str') + \ | |
| ", ar=" + (row.area/25).round(0).astype('str') + \ | |
| ", l=" + (row.length/10).round(0).astype('str') + \ | |
| ", bbminx=" + (row.minx/2).round(0).astype('str') + \ | |
| ", bbmaxy=" + (row.maxy/2).round(0).astype('str') | |
| df["new_geom_id"] = df.apply(make_key, axis=1) |
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
| from sklearn.neighbors import KDTree | |
| def nearest_neighbor(df1, df2): | |
| kdt = KDTree(df1.as_matrix()) | |
| distances, indexes = kdt.query(df2.as_matrix(), k=1, return_distance=True) | |
| return pd.Series(distances.flatten(), index=df1.index.values[indexes.flatten()]) | |
| import sys | |
| import pandas as pd |
OlderNewer