Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python transpose np array

>>> a = np.array([[1, 2], [3, 4]])
>>> a
array([[1, 2],
       [3, 4]])
>>> a.transpose() #or a.T
array([[1, 3],
       [2, 4]])
Comment

np.transpose(x) array([[0, 2], [1, 3]])

>>> x = np.arange(4).reshape((2,2))
>>> x
array([[0, 1],
       [2, 3]])
Comment

PREVIOUS NEXT
Code Example
Python :: array sort in python 
Python :: random generator python 
Python :: run python code online 
Python :: python int to ascii string 
Python :: python unicode point to utf8 string 
Python :: login views django template passing 
Python :: best jarvis code in python 
Python :: // in python means 
Python :: find position of key in dictionary python 
Python :: looping nested dictionaries 
Python :: how to activate venv python 
Python :: python if greater than and less than 
Python :: tuplein python 
Python :: dot product of lists 
Python :: python while loop 
Python :: set() python 
Python :: Bellman-Ford 
Python :: dijkstra algorithm 
Python :: print column name and index 
Python :: python array empty 
Python :: string contains element of list python 
Python :: python mark function as no return 
Python :: how to change the starting number for the loop count in pythin 
Python :: python - notification messages 
Python :: ex:deleate account 
Python :: how to stop a while loop in opencv 
Python :: #adding for loop with tuple and having space 
Python :: remove color from shapefile python 
Python :: converting from series to dataframe with tabulate 
Python :: dataframe conditional formatting max values 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =