pmorissette / ffn

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

Replacing the obsolete applymap with map. #235

Closed quant12345 closed 4 months ago

quant12345 commented 4 months 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