[SciPy-user] arraysetops & string arrays

Robert Cimrman cimrman3 at ntc.zcu.cz
Thu Dec 20 05:31:41 EST 2007


Hi David!

David Warde-Farley wrote:
> Hi there,
> 
> I noticed that setdiff1d() fails on string arrays.  (numpy 1.0.3.1).  
> There's nothing in the documentation that suggests it's for numeric  
> dtypes only; should there be, or is this a bug?
> 
> The problem appears to be the line
> 
> tt = nm.concatenate( (zlike( ar1 ), zlike( ar2 ) + 1) )
> 
> where zlike() is returning an array of empty strings, and thus adding  
> 1 is causing problems. I tried modifying it to cast to int32 without  
> much success.

Fixed in SVN. It was more a missing feature than a bug - I did not 
realized that it should work for non-numerical arrays, too.

If you do not use SVN, I can mail you the fix, just tell me.

If other functions have the same problems, let me know, please.

r.




More information about the SciPy-User mailing list