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

Indexing ObsCollection always returns "obs" column #210

Open
martinvonk opened this issue Apr 12, 2024 · 6 comments
Open

Indexing ObsCollection always returns "obs" column #210

martinvonk opened this issue Apr 12, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@martinvonk
Copy link
Collaborator

martinvonk commented Apr 12, 2024

Not sure why this happens but when I use loc on the ObsCollection the column with the "obs" is always returned

oc_sel = oc.loc[:, ["x", "y"]]
oc_sel.columns -> Index(['x', 'y', 'obs'], dtype='object')

Same happens with iloc
oc.iloc[:, [0,1]]

@martinvonk
Copy link
Collaborator Author

This is the reason why #209 fails

@martinvonk
Copy link
Collaborator Author

martinvonk commented Apr 12, 2024

Happened to me after updating pandas to v.2.2.2
Updating pandas (2.2.1 -> 2.2.2)

martinvonk added a commit that referenced this issue Apr 12, 2024
@martinvonk martinvonk self-assigned this Apr 12, 2024
@martinvonk
Copy link
Collaborator Author

Not sure if we need to do something with this. #209 is already fixed.
Maybe if behavior keeps existing after v2.2.2 we need to adress this.

@martinvonk martinvonk added the bug Something isn't working label Apr 12, 2024
@OnnoEbbens
Copy link
Collaborator

It has become an issue in the bro_bronhouder notebook now as well. I think it has something to do with this error: pandas-dev/pandas#57032

@OnnoEbbens
Copy link
Collaborator

Geopandas had the same problem: geopandas/geopandas#3060

@OnnoEbbens
Copy link
Collaborator

For now I will pin the pandas version to 2.2.1 or lower because this also gives errors in nlmod.

OnnoEbbens added a commit that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants