pymer4 icon indicating copy to clipboard operation
pymer4 copied to clipboard

Make a FutureWarning go away when running Lmer.py

Open paulcbogdan opened this issue 10 months ago • 0 comments

pymer4.models.lmer has started to produce a FutureWarning:

FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. ran_vars = ran_vars.applymap(

Explanation: Pandas 2.1.0 marked DataFrame.applymap as deprecated and suggests DataFrame.map is used instead. The below commit attempts to fix. Simply changing .applymap to .map in pymer4 would break backward compatibility for some users, as .map was only introduced in 2.1, so this code checks for whether the DataFrame has the .map function first

paulcbogdan avatar Apr 20 '24 10:04 paulcbogdan