Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to input a string character into a numpy zeros imatrix n python

a = np.zeros((3,3))
a 
array([[ 0.,  0.,  0.],
       [ 0.,  0.,  0.],
       [ 0.,  0.,  0.]])

a = np.zeros((3,3),int)
a
array([[0, 0, 0],
       [0, 0, 0],
       [0, 0, 0]])

a = np.zeros((3,3),bool)
a
array([[False, False, False],
       [False, False, False],
       [False, False, False]], dtype=bool)

a = np.zeros((3,3),str)
a 
array([['', '', ''],
       ['', '', ''],
       ['', '', '']],
      dtype='<U1')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #string #character #numpy #zeros #imatrix #python
ADD COMMENT
Topic
Name
7+8 =