[Numpy-discussion] rank-0 chararrays?
falted at openlc.org
Mon Feb 17 11:08:01 CST 2003
I'm trying to map Numeric character typecode ('c') to chararrays, but I have
a problem to distinguish between
In : chararray.array("qqqq")
In : chararray.array(["qqqq"]) # Note the extra "[" "]"
Out: CharArray(['qqqq']) # The same result as 109
while in Numeric we have:
In : Numeric.array("qqqq")
Out: array([q, q, q, q],'c')
In : Numeric.array(["qqqq"])
Out: array([ [q, q, q, q]],'c') # Differs from 113
even in numarray objects, rank-0 seems to work well:
In : numarray.array(1)
In : numarray.array()
Out: array() # Objects differ
So, it seems like if chararray does not support well rank-0 objects. Is this
the expected behavior?. If yes, we have no possibility to distinguish
between object 109 and 110, and I'd like to distinguish between this two.
What can be done to achieve this?
More information about the Numpy-discussion