Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

343
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda