On Wed, Sep 25, 2013 at 9:06 AM, Edmondo Porcu <edmondo.po...@gmail.com> wrote:
> I am a Newbie with Numpy and I would need some advice on how to create a
> matrix with certain characteristics :
>
>  - Every entry should be minimum 0 maximum 1 with a step of 0.1 (legal
> values are 0,0.1,0.2,0.3 etc)

You can generate random integers between 0 and 10, and divide them by 10:

np.random.random_integers(0, 10, (5, 5)) / 10.

> - Only the rows where the sum is 1 must be kept

I'm not sure I understand the exact structure you describe.  Perhaps
an example would help.

Stéfan
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to