TDC icon indicating copy to clipboard operation
TDC copied to clipboard

Compatibility with Pandas 2.0+

Open DannyCollinson opened this issue 1 year ago • 2 comments

As of Pandas version 2.0, the append() method for DataFrames is deprecated, causing problems loading negative samples.

To Reproduce With pandas version 2.0+ installed,

from tdc.multi_pred import MTI
data = MTI(name = 'miRTarBase')
data = data.neg_sample(frac = 1)

causes AttributeError: 'DataFrame' object has no attribute 'append'

To Fix For now, you can run neg_sample() with pandas 1.5.3 or below, but compatibility with Pandas version 2.0+ will require replacing df.append() calls with calls to pd.concat().

DannyCollinson avatar May 17 '23 20:05 DannyCollinson

Thanks for raising this issue! We will update the code in the next release!

kexinhuang12345 avatar May 30 '23 20:05 kexinhuang12345

Hello, any updates for this issue?

skywalker2202 avatar Sep 12 '23 12:09 skywalker2202

@skywalker2202 have a look at package version >= 0.4.7 , feel free to also run from this gh repo in a conda environment using environment.yml

amva13 avatar Apr 23 '24 13:04 amva13