Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python NumPy swapaxis Function Example 2

# welcome to softhunt.net
# Python program explaining
# numpy.swapaxes() function

# importing numpy as np
import numpy as np

arr = np.array([[[0, 1], [4, 5]], [[2, 3], [6, 7]]])

softhunt = np.swapaxes(arr, 0, 2)

print (softhunt)
Comment

Python NumPy swapaxis Function Syntax

numpy.swapaxes(arr, axis1, axis2)
Comment

Python NumPy swapaxis Function Example

# welcome to softhunt.net
# Python program explaining
# numpy.swapaxes() function

# importing numpy as np
import numpy as np

arr = np.array([[1, 2, 3, 4]])

softhunt = np.swapaxes(arr, 0, 1)

print (softhunt)
Comment

PREVIOUS NEXT
Code Example
Python :: nlargest heapq 
Python :: python random hash 
Python :: round down python 
Python :: int object is not subscriptable in python 
Python :: Python cheat sheet pdf download 
Python :: Palindrome Check using for loop in python 
Python :: Python program to check Co-Prime Number 
Python :: check missing dates in pandas 
Python :: python pandas replace not working 
Python :: pandas read cell value by index and column name 
Python :: pipenv with specific python version 
Python :: how to make minecraft using python 
Python :: read specific rows from csv in python 
Python :: MovieWriter stderr: ffmpeg: error while loading shared libraries: libopenh264.so.5: cannot open shared object file: No such file or directory 
Python :: difference of two set in python 
Python :: python list comprehension elif 
Python :: how to read excel with multiple pages on pandas 
Python :: random picker in python 
Python :: python add element to array 
Python :: how to use a string variable as a variable name in python 
Python :: how to iterate over rows in a dataframe in pandas 
Python :: how to create a list in python 
Python :: tkinter button position 
Python :: python groupby sum single columns 
Python :: hello world in python 
Python :: boxplot groupby pandas 
Python :: pygame how to draw a rectangle 
Python :: # invert a dictionary 
Python :: get dictionary elements by index in python 
Python :: how to find 1 st digit in python 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =