[SciPy-User] structured array question? (slow learner :)

Vincent Davis vincent@vincentdavis....
Sun Mar 7 15:02:13 CST 2010

Thanks again for the help, My point in mentioning that I was not able to
find the answer was to point out that the information is spread out and not
obvious the first time you look for the information. The fact that a10 |S10,
S10 are the same thing and numpy.str does not get rejected but does not work
is confusing the first time you look at it, I was suggesting that it could
be presented a little better. Probably the only contribution I can make is
to point out that there is a lack of documentation from the perspective of a

Thanks Again

*Vincent Davis
720-301-3003 *
 my blog <http://vincentdavis.net> |

On Sun, Mar 7, 2010 at 7:58 AM, Ryan May <rmay31@gmail.com> wrote:

> On Sat, Mar 6, 2010 at 3:08 PM, Vincent Davis <vincent@vincentdavis.net>wrote:
>> Again I am new to this but I spent 2hr on this and looked at the
>> documentation an tutorials. To be fare there are not a lot of examples using
>> strings.
>> I would suggest that there are two many ways to specify dtype. At least
>> that is my impression.
>> I would find a nice table that list all with the different way they are
>> used.
>> for example
>> @ Ryan used ('xb','S5')
>> @ Christopher used  ('xb', '|S10')
> These are both specifying strings.  'S5' is just specifying a string length
> of 5 while '|S10' is specifying a string length of 10.  The '|' is optional
> and specifies that the system-native endianness should be used to control
> the byte ordering. So these are both the exact same way.
>> I tried ('xb', |S10)
> There's no way this actually ran without quotes.
>> there is also a10 or somthing
> 'a' is the same as using 'S' above.
>> numpy.float64() can be used
> That's for floating point types, not strings. A lot of the complexity from
> strings is that, unlike numeric types, there's no minium/typical sizes to
> assume for strings. This, combined with the fact that all items within a
> numpy array have to have the same size, makes string handling complex.
> (This implies that in memory, (1,1,'apple', 'pie') and (2,5,'boys','play')
> will occupy the same amount of memory.)
> Did you look at this:
> http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html
> Ryan
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100307/ad8315d1/attachment.html 

More information about the SciPy-User mailing list