transitland / transitland-processing-animation

Animating scheduled transit trips using the Transitland API and Processing
MIT License
279 stars 55 forks source link

cannot be converted to a Series #9

Closed szeemi closed 6 years ago

szeemi commented 6 years ago

Hi,

I'm trying to work with Budapest transport company (BKK). The data downloads but it fails to create the sketch file and gives me this:

1 operators successfully downloaded. 0 operators failed. Concatenating individual operator outputs. Calculating trip segment bearings. Traceback (most recent call last): File "transitflow.py", line 376, in df['bearing'] = df.apply(lambda row: calc_bearing_between_points(row['start_lat'], row['start_lon'], row['end_lat'], row['end_lon']), axis=1) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/frame.py", line 2331, in setitem self._set_item(key, value) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/frame.py", line 2396, in _set_item self._ensure_valid_index(value) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/frame.py", line 2378, in _ensure_valid_index raise ValueError('Cannot set a frame with no defined index ' ValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series

best

willgeary commented 6 years ago

Hi, a recent update fixes this problem @szeemi .

Please download the latest version and try: python concatenate_csvs.py --name=budapest --operator=o-u2m-bkk

It works for me: Budapest Transit Flows

szeemi commented 6 years ago

Great

Thanks for your quick help, appreciate it.

best

tamas

On Thu, Oct 12, 2017 at 6:25 AM, Will Geary notifications@github.com wrote:

Closed #9 https://github.com/transitland/transitland-processing-animation/issues/9 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/transitland/transitland-processing-animation/issues/9#event-1289488483, or mute the thread https://github.com/notifications/unsubscribe-auth/AP6vMJCgpUypE0PEr_-AkgdDVUXD5fhsks5srZTWgaJpZM4P1Svw .

willgeary commented 6 years ago

@szeemi I went ahead and created a video for Budapest: https://vimeo.com/237854853

AnthonyLovesBikes commented 6 years ago

Hello, I have updated to the latest versions, but still get the result below when trying to query GO Transit in Ontario, Canada. --operator=o-dpz-gotransit

C:\Users\Anthony\Desktop\transitland-processing-animation-master\transitflow>python transitflow.py --name=GO --operator=o-dpz-gotransit --date=2018-04-25

INPUTS:
date:  2018-04-25
name:  GO
API key:  None
1 operators to be downloaded.

o-dpz-gotransit 1 / 1
http://transit.land/api/v1/routes?per_page=10000&operated_by=o-dpz-gotransit
54 routes found.

http://transit.land/api/v1/stops?per_page=10000&served_by=o-dpz-gotransit
1321 stops found.

http://transit.land/api/v1/schedule_stop_pairs?date=2018-04-25&per_page=10000&sort_min_id=0&operator_onestop_id=o-dpz-gotransit
0 schedule stop pairs found.

success!

1 operators successfully downloaded.
0 operators failed.
Concatenating individual operator outputs.
Calculating trip segment bearings.
Traceback (most recent call last):
  File "transitflow.py", line 406, in <module>
    df['bearing'] = df.apply(lambda row: calc_bearing_between_points(row['start_lat'], row['start_lon'], row['end_lat'], row['end_lon']), axis=1)
  File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2331, in __setitem__
    self._set_item(key, value)
  File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2396, in _set_item
    self._ensure_valid_index(value)
  File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2378, in _ensure_valid_index
    raise ValueError('Cannot set a frame with no defined index '
ValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series

When you said:

Please download the latest version and try: python concatenate_csvs.py --name=budapest --operator=o-u2m-bkk

do you mean to run this after first attempt fails? The result I get when running that is below:

C:\Users\Anthony\Desktop\transitland-processing-animation-master\transitflow>python concatenate_csvs.py --name=GO --operator=o-dpz-gotransit
usage: concatenate_csvs.py [-h] [--date DATE] [--apikey APIKEY] [--name NAME]
                           [--bbox BBOX] [--clip_to_bbox] [--frames FRAMES]
                           [--animate] [--recording] [--skip_bearings]
concatenate_csvs.py: error: unrecognized arguments: --operator=o-dpz-gotransit