I want to create an empty matrix and then insert letters inside.
s = np.zeros(2,3)
s[0,0]='A'
Output:
ValueError: could not convert string to float: 'A'
From my understanding matrix s only accepts numbers, so it rejects the string A. But is it possible to do it without complicated functions?
>Solution :
It can be done, just specify dtype=object:
s = np.zeros((2,3), dtype=object)
s[0,0]='A'