jbkinney / logomaker

Software for the visualization of sequence-function relationships
MIT License
179 stars 34 forks source link

pandas 2.1.0 deprecation warning #36

Open michauhl opened 1 year ago

michauhl commented 1 year ago

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 commented 1 year ago

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

3f6a commented 1 year ago

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

I would say the culprit are these two lines: https://github.com/jbkinney/logomaker/blob/76aae02e03af9a5abc0880054d7d0c9a6f571c07/logomaker/src/Logo.py#L1073 and https://github.com/jbkinney/logomaker/blob/76aae02e03af9a5abc0880054d7d0c9a6f571c07/logomaker/src/Logo.py#L1131 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 commented 1 year ago

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

ori-scala commented 9 months ago

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

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

DomML commented 2 months ago

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

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

tjlundgren commented 4 weeks ago

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