[Numpy-discussion] comparing string array with None raises ValueError

Sebastian Haase haase at msg.ucsf.edu
Thu Jun 24 10:42:20 EDT 2004


On Thursday 24 June 2004 10:31 am, Todd Miller wrote:
> On Thu, 2004-06-24 at 13:06, Sebastian Haase wrote:
> > Hi,
> > I'm not sure if this is fixed already in CVS but here it goes:
> > I'm working with record arrays, and trying to access a field with
> >
> > type '10a80' - that is, an array of 10 80 char 'strings' :
> > >>> q.Mrc.hdr = q.Mrc.hdrArray[0].field
> > >>> q.Mrc.hdr('title') != None
>
> Shouldn't this be:
>
> q.Mrc.hdr('title') != ""

No, I understand that this makes more sense, but I have some "display 
hook"-code that compares everything with None...
In general it must be OK to compare anything with None, right ?
(BTW, I get the same error with == and !=)

Regards,
Sebastian Haase




More information about the NumPy-Discussion mailing list