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

'Series' object has no attribute 'iteritems': pandas incompatibility #182

Open
youcefker opened this issue Apr 26, 2024 · 1 comment
Open

Comments

@youcefker
Copy link

I am using the example code:

import peartree as pt

feed = pt.get_representative_feed("./gtfs.zip")
start = 7*60*60  # 7:00 AM
end = 10*60*60  # 10:00 AM

G = pt.load_feed_as_graph(feed, start, end)

these are the versions for peartree and pandas:

peartree version: 0.6.4
pandas version: 2.2.2

and this is the error I got:

[anaconda3\envs\ox\Lib\site-packages\peartree\graph.py](http://localhost:8888/lab/workspaces/auto-y/tree/~/AppData/Local/anaconda3/envs/ox/Lib/site-packages/peartree/graph.py) in ?(G, name, stops_df, exempt_nodes, connection_threshold)
    193                                           connection_threshold,
    194                                           exempt_id=full_sid)
    195 
    196         # Iterate through series results and add to output
--> 197         for node_id, dist_val in nearest_nodes.iteritems():
    198             stop_ids.append(sid)
    199             to_nodes.append(node_id)
    200             edge_costs.append(dist_val)
@giancarlohc
Copy link

I hope this gets patched but the workaround is to go into graph.py and change iteritems() to items(). I don't know if it breaks anything but I got peartree to plot.

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

No branches or pull requests

2 participants