If I have a numpy ndarray of dtype string:
from numpy import array as narray
a = narray(['a', 'b'])
how do I add another string to it? And how do I access that string via an index?
If I have a numpy ndarray of dtype string:
from numpy import array as narray
a = narray(['a', 'b'])
how do I add another string to it? And how do I access that string via an index?
Check out http://docs.scipy.org/doc/numpy/reference/generated/numpy.insert.html
For example,
numpy.insert( a, 2, 'c' )
would insert c
at position 2 in a
.