[Numpy-discussion] Empty strings not empty?
Tue Dec 29 18:18:27 CST 2009
On Wed, Dec 30, 2009 at 8:52 AM, Matthew Brett <email@example.com> wrote:
> In : e == z
> Out: array([ True], dtype=bool)
Ok, it looks like there are at least two issues:
- if an item in a string array is set to '¥x00', this seems to be
replace with '', but '' != '¥x00']
x = np.array(["¥x00"])
x == '' " # True, but should be False ?
- if an item in a string array is set to '', tostring will convert it
to '¥x00' :
x = np.array([""])
x.tostring() == ["¥00"] # True, but should be False ?
I guess the root cause is that there does not seem to be a "|S0" type
- but that may be difficult to implement, since the array would have >
0 items, but a 0 size. It may have other, but as quirky behavior.
What do you need this for ?
More information about the NumPy-Discussion