Cubist icon indicating copy to clipboard operation
Cubist copied to clipboard

Replace deprecated DataFrame.applymap

Open ramongss opened this issue 1 year ago • 1 comments

While using cubist, I'm receiving the following warning:

/opt/conda/lib/python3.10/site-packages/cubist/_make_data_string.py:67: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
  x = x.applymap(lambda a: a.lstrip())

I suppose that it's possible to solve this by fixing this line:

https://github.com/pjaselin/Cubist/blob/d3e7d6e603d8d527f03a3cb1f78c1fd08d403781/cubist/_make_data_string.py#L67

ramongss avatar May 12 '24 19:05 ramongss

Hi @ramongss! I'm assuming you're using pandas 2.2. I'm wondering if I need to test whether pandas has the attribute and use one or the other to be safe and backwards compatible.

pjaselin avatar May 15 '24 23:05 pjaselin