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

Index Issue #5

Closed
BlakeatFrasers opened this issue Aug 10, 2022 · 3 comments
Closed

Index Issue #5

BlakeatFrasers opened this issue Aug 10, 2022 · 3 comments

Comments

@BlakeatFrasers
Copy link

Hi,

I am quite new to python, and I am trying to create a python script in Visual Studio. But I am receiving the following error message. Is there a solution?

Many thanks
Blake
image

@chrieke
Copy link
Owner

chrieke commented Aug 10, 2022

Hi @BlakeatFrasers not sure about this, seems to related to pandas / geopandas dataframe. Could you check your osmnx / pandas / geopandas installation? What happens if you print aoi & df variables?

@BlakeatFrasers
Copy link
Author

Thanks for the quick reply @chrieke

osmnx seems to be causing the issue. This was fixed by re-installing the package. The version re-installed was 1.2.2, if this helps.

Cheers Blake

@filipmnowak
Copy link

fresh installation:

Traceback (most recent call last):
  File "/home/fmn/.data/workshop/prettymap/run.py", line 7, in <module>
    df = get_osm_geometries(aoi=aoi)
  File "/home/fmn/.data/workshop/prettymap/venv/lib/python3.10/site-packages/prettymapp/osm.py", line 22, in get_osm_geometries
    df = df.droplevel(level=0)
  File "/home/fmn/.data/workshop/prettymap/venv/lib/python3.10/site-packages/pandas/core/generic.py", line 919, in droplevel
    new_labels = labels.droplevel(level)
  File "/home/fmn/.data/workshop/prettymap/venv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 2183, in droplevel
    return self._drop_level_numbers(levnums)
  File "/home/fmn/.data/workshop/prettymap/venv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 2194, in _drop_level_numbers
    raise ValueError(
ValueError: Cannot remove 1 levels from an index with 1 levels: at least one level must be left.

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

3 participants