2017-08-04 30 views
2

我有一個Python腳本導入的瓶頸如下:導入錯誤:無法導入名稱argpartsort

from bottleneck import argpartsort 

我有以下錯誤:

ImportError: cannot import name argpartsort 

我從link安裝Python的瓶頸包並測試了一個簡單的程序併成功執行。但是,我仍然遇到了另一個腳本的上述錯誤。我不包括在崗python腳本,因爲錯誤是在腳本語句from bottleneck import argpartsort

回答

3

我相信這將有助於:

Functions partsort and argpartsort have been renamed to partition and argpartition to match NumPy. Additionally the meaning of the input arguments have changed: bn.partsort(a, n) is now equivalent to bn.partition(a, kth=n-1). Similarly for bn.argpartition.

here

所以,現在它會像:

from bottleneck import argpartition 
+0

It works,thank you @Ubdus – cpwah

+0

您可以接受它作爲答案! –

+0

是的,當然。謝謝。 – cpwah

相關問題