Skip to content
Advertisement

AttributeError: ‘module’ object has no attribute ‘percentile’

I use this function to calculate percentile from here:

JavaScript

But I get this error :

JavaScript

I also tried

JavaScript

but it didn’t I got the same error.

my numpy version is 1.3.0 I tried to upgrade but it seems like it won’t I used : [sudo pip install --upgrade scipy][2] but I found that there’s no upgrade.

my ubuntu version 9.10

my python version is : 2.6.4

i also tried to go arround the numpy.percentile module and I found this here:

JavaScript

but when I tried to find 0.5 percentile manually I found 5

Can anyone help explain to me why this is happening in any of those cases?

Advertisement

Answer

The percentile function was added in version 1.5.x. You will need to upgrade to at least that version.

Did you try:

JavaScript

To check which version you are running, start the python console and run:

JavaScript

You can also do:

JavaScript

The Ubuntu 9.10 numpy package uses version 1.3.03. It is likely that installing version 1.7.0 vai pip was successful, but your machine is defaulting to the python-numpy version instead. You can remove by running:

JavaScript
Advertisement