Answers for "Python NumPy expand_dims Function Example"

0

Python NumPy expand_dims Function Example

# welcome to softhunt.net
# import numpy
import numpy as np

# using Numpy.expand_dims() function
softhunt = np.array([[1, 2], [7, 8]])
print(softhunt.shape)

softhunt = np.expand_dims(softhunt, axis = 1)
print(softhunt.shape)
Posted by: Guest on April-21-2022
0

Python NumPy expand_dims Function Example

# welcome to softhunt.net
# import numpy
import numpy as np

# using Numpy.expand_dims() function
softhunt = np.array([1, 2])
print(softhunt.shape)

softhunt = np.expand_dims(softhunt, axis = 0)
print(softhunt.shape)
Posted by: Guest on April-21-2022

Python Answers by Framework

Browse Popular Code Answers by Language