-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from ljwolf/range-queries
- Loading branch information
Showing
8 changed files
with
442 additions
and
216 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import sys | ||
import time | ||
|
||
import pandana | ||
|
||
import numpy as np | ||
import pandas as pd | ||
from pympler.asizeof import asizeof | ||
|
||
print() | ||
print("Loading data...") | ||
t0 = time.time() | ||
store = pd.HDFStore('examples/data/bayareanetwork.h5', 'r') | ||
nodes, edges = store.nodes, store.edges | ||
print(round(time.time()-t0, 1), ' sec.') | ||
|
||
print() | ||
print("Initializing network...") | ||
t0 = time.time() | ||
net = pandana.Network(nodes.x, nodes.y, edges.from_int, edges.to_int, edges[['weight']]) | ||
store.close() | ||
print(round(time.time()-t0, 1), ' sec.') | ||
|
||
print() | ||
print("Calculating nodes in 100m range...") | ||
t0 = time.time() | ||
r = net.nodes_in_range([53114882, 53107159], 100.0) | ||
print(round(time.time()-t0, 1), ' sec.') | ||
|
||
# print(net.node_idx.values) | ||
# print(net.node_idx.index.values) | ||
|
||
print(asizeof(r)) # 88.8 million bytes raw | ||
|
||
print() | ||
|
||
# dataframe.info() | ||
# dataframe.memory_usage(deep=True) | ||
# .set_index(['1','2'], inplace=True) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .network import Network | ||
|
||
version = __version__ = '0.6.1' | ||
version = __version__ = '0.7.dev0' |
Oops, something went wrong.