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

Pandas FutureWarning: Series.__getitem__ deprecation warning #152

Open
manzt opened this issue Apr 18, 2024 · 2 comments
Open

Pandas FutureWarning: Series.__getitem__ deprecation warning #152

manzt opened this issue Apr 18, 2024 · 2 comments

Comments

@manzt
Copy link
Member

manzt commented Apr 18, 2024

In higlass-python, I'm getting an error with bigwig tracks:

import higlass as hg

ts = hg.bigwig("/Users/manzt/Downloads/data.bw")
hg.view(ts.track().opts(barFillColor="red"))
image
clodius/tiles/utils.py:275: FutureWarning: Series.__getitem__ treating keys as positions is deprecated.
In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior).
To access a value by position, use `ser.iloc[pos]`
  yield cid, start, chromsizes[cid]

warning is referencing this line:

yield cid, start, chromsizes[cid]

@manzt
Copy link
Member Author

manzt commented Apr 18, 2024

Is the fix just to chromsizes.iloc[cid]? I'm not familiar enough with the code.

@nvictus
Copy link
Member

nvictus commented Apr 18, 2024

That should be it. I think chromsizes is always a Series[str, int], being indexed by position. The docstring seems to be wrong.

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

2 participants