I want to write a data string to a NumPy array. Pseudocode:
d = numpy.zeros(10, dtype = numpy.character)
d[1:6] = 'hello'
Example result:
d=
array(['', 'h', 'e', 'l', 'l', 'o', '', '', '', ''],
dtype='|S1')
How can this be done most naturally and efficiently with NumPy?
I don't want for loops, generators, or anything iterative. Can it be done with one command as with the pseudocode?