Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy ascontiguousarray Function Example Scalar to an array

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

import numpy as np

my_scalar = 50

print ("Input scalar : ", my_scalar)
	
out_arr = np.ascontiguousarray(my_scalar, dtype = np.float32)
print ("output array from input scalar : ", out_arr)
print(type(out_arr))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #NumPy #ascontiguousarray #Function #Example #Scalar #array
ADD COMMENT
Topic
Name
1+5 =