Answers for "Meaning of X = X[:, 1] in Python"

0

Meaning of X = X[:, 1] in Python

x = np.random.rand(3,2)

x
Out[37]: 
array([[ 0.03196827,  0.50048646],
       [ 0.85928802,  0.50081615],
       [ 0.11140678,  0.88828011]])

x = x[:,1]

x
Out[39]: array([ 0.50048646,  0.50081615,  0.88828011])
Posted by: Guest on May-01-2021

Browse Popular Code Answers by Language