I am having some seemingly trivial trouble with numpy when the array contains string data. I have the following code:
my_array = numpy.empty([1, 2], dty
What works best if you are doing a for loop is to start a list comprehension, which will allow you to allocate the right memory.
data = ['CAT','APPLE,'CARROT'] my_array = [name for name in data]