Generate random values from a distribution in Python

5

Hello

I'm trying to generate random values from a distribution (Gamma, normal and etc) in python, but I'm having trouble importing the library. I am using the following library "import scipy.special as sps", but it is giving error ... using both Python 2 and Python 3.

Thank you in advance.

    
asked by anonymous 11.11.2015 / 19:24

4 answers

0

As the default terminal is python 3, the problem arises that numpy does not support python 3. So one solution I had is to use python 2 and install the modules: python2-numpy python2-scipy.

That's right.

    
18.11.2015 / 13:27
1

I personally believe that the most correct way to import the library would be:

from scipy import special

A similar question can be seen here . Importing the library as you suggest does not seem possible.

    
11.11.2015 / 19:44
0

You need to download the module in order to use it.

Type in the terminal (or cmd)

pip install scipy
    
12.11.2015 / 02:49
0

Download the numpy module along with the scipy that works! Go to the terminal and paste or type the line below.

sudo apt-get install python-numpy python-scipy
    
13.11.2015 / 14:44