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 pandas data frame with set will be deprecated #7

Closed
psl-schaefer opened this issue Aug 25, 2022 · 13 comments
Closed

Indexing pandas data frame with set will be deprecated #7

psl-schaefer opened this issue Aug 25, 2022 · 13 comments

Comments

@psl-schaefer
Copy link
Collaborator

psl-schaefer commented Aug 25, 2022

In:

self.regions_to_db = ctx_db.regions_to_db[self.name] if type(ctx_db.regions_to_db) == dict else ctx_db.regions_to_db.loc[set(coord_to_region_names(self.region_set)) & set(ctx_db.regions_to_db['Target'])]

I get the following error:

"Passing a set as an indexer will be deprecated and will raise in a future version. Use a list instead."

Using Pandas version 1.4.3 (the most recent version).

I guess you just have to wrap list around the set.

@psl-schaefer psl-schaefer changed the title Indexing pandas data frame with set is deprecated Indexing pandas data frame with set will be deprecated Aug 25, 2022
@SeppeDeWinter
Copy link
Collaborator

SeppeDeWinter commented Aug 25, 2022

Hi @schae211

We are aware of this warning message.
Indeed converting to a list will solve it.

However, did the motif enrichment actually crash? (normally it should just print the warning but continue running).

Best,

S

@psl-schaefer
Copy link
Collaborator Author

Hi @SeppeDeWinter

I was looking into this #8, and for a second I thought this issue here might have something to do with it. But this is not the case.

@SeppeDeWinter
Copy link
Collaborator

Hi @schae211

Indeed, it's not the case.

Thank you for the nice bug report in #8, I will take a look as soon as possible.

In the mean time I will close this issue.

Best

S

@Gat2018
Copy link

Gat2018 commented Oct 14, 2023

I am constructing ancenstral state with pastml package and I got this error any help please

/usr/local/lib/python3.8/dist-packages/pandas/core/computation/expressions.py:20: UserWarning: Pandas requires version '2.7.3' or newer of 'numexpr' (version '2.7.1' currently installed).
from pandas.core.computation.check import NUMEXPR_INSTALLED
Traceback (most recent call last):
File "/home/manager/.local/bin/pastml", line 8, in
sys.exit(main())
File "/home/manager/.local/lib/python3.8/site-packages/pastml/acr.py", line 1227, in main
pastml_pipeline(**vars(params))
File "/home/manager/.local/lib/python3.8/site-packages/pastml/acr.py", line 649, in pastml_pipeline
_validate_input(tree, columns, name_column if html_compressed or html_mixed else None, data, data_sep, id_index,
File "/home/manager/.local/lib/python3.8/site-packages/pastml/acr.py", line 865, in _validate_input
filtered_df = df.loc[common_ids, :]
File "/usr/local/lib/python3.8/dist-packages/pandas/core/indexing.py", line 1091, in getitem
check_dict_or_set_indexers(key)
File "/usr/local/lib/python3.8/dist-packages/pandas/core/indexing.py", line 2611, in check_dict_or_set_indexers
raise TypeError(
TypeError: Passing a set as an indexer is not supported. Use a list instead.

@SeppeDeWinter
Copy link
Collaborator

@Gat2018

Could you please elaborate a bit more on what you are trying to do?
I'm not familiar with the pastml package.

All the best,

Seppe

@Gat2018
Copy link

Gat2018 commented Oct 17, 2023 via email

@SeppeDeWinter
Copy link
Collaborator

Okay, and with which part of the code do you get this error? Can you show which command you were running?

Best,

Seppe

@Gat2018
Copy link

Gat2018 commented Oct 18, 2023 via email

@SeppeDeWinter
Copy link
Collaborator

Hi @Gat2018

I'm sorry but I don't see the command ...

Could you please copy-paste it (as text) in a comment on this issue?

Best,

Seppe

@Gat2018
Copy link

Gat2018 commented Oct 18, 2023 via email

@SeppeDeWinter
Copy link
Collaborator

I don't see the text file, that is the issue.

So if you could just copy-paste the command and error (as a comment to this github issue) I can try and help you.

@Gat2018
Copy link

Gat2018 commented Oct 18, 2023 via email

@SeppeDeWinter
Copy link
Collaborator

Hi @Gat2018

This issue is not related to pycistarget (the repo where you are posting your issue).
I guess you want to open an issue on the pastml repo https://github.com/evolbioinfo/pastml?

All the best,

Seppe

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