pymer4
pymer4 copied to clipboard
Make a FutureWarning go away when running Lmer.py
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