Python Warning while executing code
Hi Hristina,
I got a Python Warning while executing the attached code statement. What does it mean and what needs to be amended in the code so that this warning does not appear? Please see attachment (comments are for my understanding).
Hey Dhaivat,
Thank you for reaching out!
Could you please let me know which version of scikit-learn
you are using? You can retrieve it by typing
conda list
in your Anaconda Prompt.
Kind regards,
365 Hristina
version. 1.2.2
Hey again Dhaivat,
If you open the "validation.py" file referenced in the error message (C:\Users\dhaiv\...) using any text editor or IDE, you'll find that the source code uses pandas
' is_sparse()
method which is deprecated since version 2.1.0 (likely, this is the version you're using or higher):
https://pandas.pydata.org/docs/reference/api/pandas.api.types.is_sparse.html
The solution would therefore be to update the scikit-learn
package to the latest version where this pandas
method is not referenced and the method isinstance()
is used instead:
https://scikit-learn.org/stable/install.html
Let me know if you experience issues in the process.
Kind regards,
365 Hristina
Hi Hristina,
All warnings disappered!! Thanks again.
Regards,
Dhaivat
PS: I got my answers to the Machine Learning in Excel course. Thanks for the nudge!!
Hey Dhaivat,
Great, I'm happy all issues are resolved!
Kind regards,
365 Hristina