Sameer DCosta wrote:
> I'm trying to convert a character array to a floating point array. I'm
> using one of the recent svn builds. It is surprising that astype does
> not do the job. However if I first convert the char array to an array
> and then use astype everything works fine. Is this a bug?
>
On Wednesday 28 November 2007 13:39:45 Matthieu Brucher wrote:
> a does not seem to be an array, so it is not surprising that you need to
> convert it to an array first.
Well, a *IS* a regular chararray, and therefore a subclass of ndarray (try
isinstance). The problem isn't here, it's that the s
Sameer,
I can't tell whether it's a bug or a feature, but I can give you some
explanation: when you call .astype on your chararray, you call the
__array_finalize__ of the chararray, which requires the dtype to be string
like. Obviously, that won't work in your case. Transforming the chararray t
a does not seem to be an array, so it is not surprising that you need to
convert it to an array first.
Matthieu
2007/11/28, Sameer DCosta <[EMAIL PROTECTED]>:
>
> I'm trying to convert a character array to a floating point array. I'm
> using one of the recent svn builds. It is surprising that ast
I'm trying to convert a character array to a floating point array. I'm
using one of the recent svn builds. It is surprising that astype does
not do the job. However if I first convert the char array to an array
and then use astype everything works fine. Is this a bug?
import numpy as N
print N.__v