Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial Question concerning set_pois, pandana 0.3.0 #82

Closed
apiszcz opened this issue May 12, 2017 · 2 comments
Closed

Tutorial Question concerning set_pois, pandana 0.3.0 #82

apiszcz opened this issue May 12, 2017 · 2 comments

Comments

@apiszcz
Copy link

apiszcz commented May 12, 2017

the x,y variables are not defined, I tried 'x','y' and ['x','y'] which produce other pandas errors.

net.set_pois("restaurants", x, y)
produces
*** NameError: name 'x' is not defined


import pandas as pd
import pandana as pdna
store = pd.HDFStore('osm_bayarea.h5', "r")
nodes = store.nodes
edges = store.edges
print(nodes.head(3))
print(edges.head(3))
net=pdna.Network(nodes["x"], nodes["y"], edges["from"], edges["to"],edges[["weight"]])
net.precompute(3000)
net.init_pois(num_categories=1, max_dist=2000, max_pois=10)
net.set_pois("restaurants", x, y)
@apiszcz
Copy link
Author

apiszcz commented May 12, 2017

Are the assignments missing from the tutorial?

y=nodes.y
x=nodes.x

@sablanchard
Copy link
Collaborator

Hello!
The tutorial here says This code initializes the “restaurants” category with the positions specified by the x and y columns (which are Pandas Series). The tutorial does not explicitly create the x and y series but instructs you that that is what they are. In the actual code demonstration here shows the full workflow and the creation of the x and y series in code.

Will close this unless there an issue with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants