After scipy@1.8.0, the scipy.sparse.csr namespace is deprecated. So category_encoders asserts the DeprecationWarning when it depends scipy:^1.8.0;
$ python -Wd
Python 3.10.4 (main, Apr 6 2022, 00:48:19) [GCC 7.3.1 20180712 (Red Hat 7.3.1-13)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import category_encoders
(omitted)/python3.10/site-packages/category_encoders/utils.py:5: DeprecationWarning: Please use `csr_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.csr` namespace is deprecated.
from scipy.sparse.csr import csr_matrix
>>> category_encoders.__version__
'2.4.0'
>>> import scipy
>>> scipy.__version__
'1.8.0'
We need to use csr_matrix from the scipy.sparse namespace. This namespace exists at least scipy@1.0.0 until now (docs)
Proposed Changes
To avoid the DeprecationWarning, we import csr_matrix from the scipy.sparse instead of the scipy.sparse.csr which is deprecated.
※ This is my first pull request, so I apologize if there are any problems. I would appreciate it if you could check it.
After scipy@1.8.0, the
scipy.sparse.csr
namespace is deprecated. Socategory_encoders
asserts the DeprecationWarning when it depends scipy:^1.8.0;We need to use
csr_matrix
from thescipy.sparse
namespace. This namespace exists at least scipy@1.0.0 until now (docs)Proposed Changes
csr_matrix
from thescipy.sparse
instead of thescipy.sparse.csr
which is deprecated.※ This is my first pull request, so I apologize if there are any problems. I would appreciate it if you could check it.