pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
1.87k stars 282 forks source link

Replacing the obsolete applymap with map. #235

Closed quant12345 closed 1 month ago

quant12345 commented 1 month ago

Replacing the obsolete applymap with map in new versions pandas.

This PR removes the warnings:

tests/test_core.py::test_random_weights
  /home/runner/work/ffn/ffn/tests/test_core.py:455: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
    assert df.applymap(lambda x: (x >= low and x <= high)).all().all()

tests/test_core.py::test_random_weights
  /home/runner/work/ffn/ffn/tests/test_core.py:467: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
    assert (

tests/test_core.py::test_random_weights
  /home/runner/work/ffn/ffn/tests/test_core.py:483: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
    assert (

tests/test_core.py::test_random_weights
  /home/runner/work/ffn/ffn/tests/test_core.py:499: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
    assert (

Replacing the obsolete applymap with map.

running tests:

pytest tests/test_core.py::test_random_weights