[Solved] (Python) Replace array of string elements


you have to specify dtype to get the expected behavior, else it will choose minimum size,
i think it is choosing chararray and you are trying add numbers/strings.

either use astype or numpy.array(data, dtype=””) to set dtype, look at the syntax of numpy.arry below

numpy.array(object, dtype=None, copy=True, order="K", subok=False, ndmin=0)

set dtype to string/integer/float whatever you need, refere doucmentation for exact use

solved (Python) Replace array of string elements