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 2.1.0 deprecation warning #36

Open
michauhl opened this issue Sep 12, 2023 · 6 comments
Open

pandas 2.1.0 deprecation warning #36

michauhl opened this issue Sep 12, 2023 · 6 comments

Comments

@michauhl
Copy link

Hi,

with pandas 2.1.0 and logomaker 0.8 I get a deprecation warning:

../condaenv/lib/python3.9/site-packages/logomaker/src//Logo.py:1131: FutureWarning:

Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '<logomaker.src.Glyph.Glyph object at 0x7f775e7b9700>' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.

Not sure how easy to fix or if possible. Just to let you know :)

Thanks & Best,
Michael

@yzhong36
Copy link

Got the same issue. I managed to have plots without warnings just by downgrading pandas to 1.5.3

@3f6a
Copy link

3f6a commented Oct 1, 2023

I am also seeing this warning recently. Any change logomaker can get an update?

I would say the culprit are these two lines:

glyph_df = pd.DataFrame()

and
glyph_df.loc[p, c] = glyph

The first one creates an empty DataFrame, and it seems empty columns by default have dtype float64. In recent versions of Pandas complain about assigning a value of a different type (Glyph, in the second line) to a column of another type.

@atareen
Copy link
Collaborator

atareen commented Oct 1, 2023

Thanks, I will plan to do a release shortly, ~ next couple of weeks.

@ori-scala
Copy link

Thanks, I will plan to do a release shortly, ~ next couple of weeks.

@atareen Hi, any estimation when such a release would happen?

@DomML
Copy link

DomML commented Aug 1, 2024

Thanks, I will plan to do a release shortly, ~ next couple of weeks.

Hi @atareen , any news of this update ?
Best,
D.

@grst grst mentioned this issue Aug 19, 2024
4 tasks
@tjlundgren
Copy link

For any still waiting,
I changed 1073 glyph_df = pd.DataFrame()
to
glyph_df = pd.DataFrame(index=self.ps,columns=self.cs,dtype=object)
which solved the issue. No idea if it is a good solution, but it worked for me

arivers added a commit to USDA-ARS-GBRU/logomaker that referenced this issue Nov 26, 2024
PAtched issue from this thread jbkinney#36
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

7 participants