[SciPy-User] structured array question? (slow learner :)
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
my blog <http://vincentdavis.net> |
On Sun, Mar 7, 2010 at 7:58 AM, Ryan May <email@example.com> wrote:
> On Sat, Mar 6, 2010 at 3:08 PM, Vincent Davis <firstname.lastname@example.org>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
>> 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
>> 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:
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User