📜  如何将字符串字符输入到 numpy zeros imatrix n python 代码示例

📅  最后修改于: 2022-03-11 14:46:16.083000             🧑  作者: Mango

代码示例2
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='