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

Fix missing agency_id error #69

Closed
takohei opened this issue Apr 24, 2023 · 0 comments
Closed

Fix missing agency_id error #69

takohei opened this issue Apr 24, 2023 · 0 comments
Labels
dataset problem regarding to GTFS dataset

Comments

@takohei
Copy link
Contributor

takohei commented Apr 24, 2023

agency_id is not a required field.
However, an error occurred if there is no agency_id in routes.txt.
The program should work even without agency_id.

An example of data that does not work is Transports Metropolitans de Barcelona.

The error message is as follows.

2023-04-24T20:35:11     WARNING    Traceback (most recent call last):
              File "C:\..\gtfs_go_dialog.py", line 279, in execution
              "features": gtfs_parser.read_route_frequency(),
              File "C:\..\gtfs_parser\__main__.py", line 542, in read_route_frequency
              self.dataframes["routes"][["route_id", "agency_id"]],
              File "C:\PROGRA~1\QGIS3~1.28\apps\Python39\lib\site-packages\pandas\core\frame.py", line 2908, in __getitem__
              indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
              File "C:\PROGRA~1\QGIS3~1.28\apps\Python39\lib\site-packages\pandas\core\indexing.py", line 1254, in _get_listlike_indexer
              self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
              File "C:\PROGRA~1\QGIS3~1.28\apps\Python39\lib\site-packages\pandas\core\indexing.py", line 1304, in _validate_read_indexer
              raise KeyError(f"{not_found} not in index")
             KeyError: "['agency_id'] not in index"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataset problem regarding to GTFS dataset
Projects
None yet
Development

No branches or pull requests

2 participants