May 10, 2010
3:40 p.m.
On Mon, May 10, 2010 at 11:23 AM, Neil Crighton <neilcrighton@gmail.com> wrote:
I've been working with pyfits, which uses numpy chararrays. I've discovered the hard way that chararrays silently remove trailing whitespace:
a = np.array(['a ']) b = a.view(np.chararray) a[0] 'a ' b[0] 'a'
Note the string values stored in memory are unchanged. This behaviour caused a bug in a program I've been writing, and seems like a bad idea in general. Is it intentional?
Neil
This is an intentional "feature", not a bug. Chris -- Christopher Hanley Senior Systems Software Engineer Space Telescope Science Institute 3700 San Martin Drive Baltimore MD, 21218 (410) 338-4338