Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

337
Vistas
from ..utils.fixes import rankdata ImportError: cannot import name 'rankdata' MongoDB

I am trying to run Skikit learn through Spyder on Anaconda

C:\Anaconda3>conda --version
conda 4.3.4
C:\Anaconda3>python --version
Python 3.5.2 :: Anaconda 4.0.0 (64-bit)
Spyder 2.3.8

I try to do the following:

print("Scikit-Learn", sklearn.__version__)
NameError: name 'sklearn' is not defined
from sklearn.model_selection import *
from ..utils.fixes import rankdata
ImportError: cannot import name 'rankdata'
Errors

Any idea why this error is coming as in Anaconda it shows the package as present but when I run through Spyder it gives the above error.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

As you are using anaconda try:

conda update scikit-learn

Conda will try to handle de dependences and it may update other packages.

If this does not work, in the file fixes.py located in <Anaconda_basedir>\lib\python3.5\site-packages\sklearn\utils there is a line if sp_version < (0,13, 0): which conditions the import of rankdata if the version of scipy is lower than 0.13.0.

For som reason, if the version is > 0.13.0 it should use the rankdata from scipy.stats. But, at least in my case it wasn't, what I did was to add a and False so it gets the rankdata from scipy.

The final line is:

...
if sp_version < (0, 13, 0) and False:
    def rankdata(a, method='average'):
...
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda