Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numpy randomly swap lines

>>> X = np.random.random((6, 2))
>>> X
array([[ 0.9818058 ,  0.67513579],
       [ 0.82312674,  0.82768118],
       [ 0.29468324,  0.59305925],
       [ 0.25731731,  0.16676408],
       [ 0.27402974,  0.55215778],
       [ 0.44323485,  0.78779887]])

>>> np.random.shuffle(X)
>>> X
array([[ 0.9818058 ,  0.67513579],
       [ 0.44323485,  0.78779887],
       [ 0.82312674,  0.82768118],
       [ 0.29468324,  0.59305925],
       [ 0.25731731,  0.16676408],
       [ 0.27402974,  0.55215778]])
Comment

PREVIOUS NEXT
Code Example
Python :: pd.concat in python 
Python :: ValueError: cannot reshape array of size 98292 into shape (16382,1,28) site:stackoverflow.com 
Python :: SUMOFPROD1 
Python :: plynomial regression implementation python 
Python :: print format python 
Python :: python not in list 
Python :: How to sort a Python dict by value 
Python :: how to generate list in python 
Python :: change value in nested dictionary python 
Python :: plt.tight_layout() cuts x axis 
Python :: torch.from_numpy 
Python :: decision tree python 
Python :: set default formatter for python vscode 
Python :: check if key exists in sesson python flask 
Python :: Python 3 program to find factorial of given number 
Python :: dicionario python 
Python :: append list python 
Python :: python opencv check image read 
Python :: remove extra blank spaces 
Python :: remove all parentheses from string python 
Python :: how to get last letter of string python 
Python :: How to efficiently search for a pattern string within another bigger one, in Python? 
Python :: list in python 
Python :: group by dataframe 
Python :: how to append data in excel using python 
Python :: yahoo finance python documentation 
Python :: python dataframe contains value 
Python :: values missing comparing datasets 
Python :: sns boxplot ylabelsize 
Python :: hex string to hex number 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =