[Numpy-discussion] np.zeros(2, 'S') returns empty strings.
Sun Jan 15 02:15:41 CST 2012
On Sat, Jan 14, 2012 at 2:12 PM, Charles R Harris
> This sort of makes sense, but is it the 'correct' behavior?
> In : zeros(2, 'S')
> array(['', ''],
I think of numpy strings as raw fixed-length byte arrays (since, well,
that's what they are), so I would expect np.zeros to return all-NUL
strings, like it does. (Not just 'empty' strings, which just means the
first byte is NUL -- I expect all-NUL.) Maybe I've spent too much time
working with C data structures, but that's my $0.02 :-)
More information about the NumPy-Discussion