Hi,

I am new to NumPy, Can someone help me in understanding below code.

>>> names = np.array(['Bob', 'Joe', 'Will', 'Bob', 'Will', 'Joe', 'Joe'])

>>> data = np.random.random((7,4))

>>> print data
[[ 0.85402649  0.12827655  0.5805555   0.86288236]
 [ 0.30162683  0.45269508  0.98098039  0.1291469 ]
 [ 0.21229924  0.37497112  0.57367496  0.08607771]
 [ 0.302866    0.42160468  0.26879288  0.68032467]
 [ 0.60612492  0.35210577  0.91355096  0.57872181]
 [ 0.11583826  0.81988882  0.39214077  0.51377566]
 [ 0.03767641  0.1920532   0.24872009  0.36068313]]

>>> data[names == 'Bob']

array([[ 0.85402649,  0.12827655,  0.5805555 ,  0.86288236],
       [ 0.302866  ,  0.42160468,  0.26879288,  0.68032467]])

Also, can someone help me where and how to practice NumPy?



--
View this message in context: 
http://numpy-discussion.10968.n7.nabble.com/Help-in-understanding-tp40827.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to