Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy asfarray Function Example Scalar to float type array

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

import numpy as np

my_scalar = 50

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