import numpy as np
from sympy import *
shape = (4,4)
X = np.empty(shape)
for i in range(shape[0]):
for j in range(shape[1]):
X[i][j] = Symbol("x"+'_{'+str(i*10+j+11)+'}')
224 if result.is_number and result.as_real_imag()[1]:
225 raise TypeError("can't convert complex to float")
--> 226 raise TypeError("can't convert expression to float")
227
228 def __complex__(self):
TypeError: can't convert expression to float
import numpy as np
shape = (4,4)
np.core.defchararray.add('x_',(((np.arange(shape[0])+1)*10).reshape(-1,1)+1 + np.arange(shape[1])).astype(np.str))
array([['x_11', 'x_12', 'x_13', 'x_14'],
['x_21', 'x_22', 'x_23', 'x_24'],
['x_31', 'x_32', 'x_33', 'x_34'],
['x_41', 'x_42', 'x_43', 'x_44']],
dtype='<U13')