hasadna / open-bus

:bus: Analysing Israel's public transport data
93 stars 27 forks source link

Error when using Python API #356

Closed EyalBerger closed 2 years ago

EyalBerger commented 2 years ago

I've copied the cells from the example notebook but I am getting this error when trying to query the database - image

Do you know what could I do to make it work?

(and minor note - "df = PD.DataFrame" should be changed to "df = pandas.DataFrame" to be aligned with the import cell)

OriHoch commented 2 years ago

the bug is not reproduced for me, looks like it gets some invalid response from the API, I will create an issue to have relevant details in the error message

regarding the import pands - it's standard usage to do import pandas as PD and then refer to pandas as PD - I believe pandas documentation itself uses it this way.

OriHoch commented 2 years ago

I added more error details, please try again with latest client and post the error you get here

if you are running locally upgrade using pip install --upgrade open-bus-stride-client

EyalBerger commented 2 years ago

Great! I've upgraded it and now it's works, thank you.

about the pandas point - I meant the code in the example isn't aligned - we "import pandas" (without as pd) but consume PD later on in the code. It isn't so important, just suggesting to align it.

OriHoch commented 2 years ago

the notebook does import pandas as PD - https://github.com/hasadna/open-bus-stride-client/blob/main/notebooks/Load%20route%20rides%20to%20dataframe.ipynb

EyalBerger commented 2 years ago

great. Closing this issue