[portland] numarray

Ryan Arana ryan.arana at gmail.com
Thu Mar 11 21:47:36 CET 2010


You can reply to the group (or use reply to all to get both), but direct
responses won't go to the rest of the group, so you usually want to avoid
those.

I think Jonathan's response to the group from a few minutes ago will
probably get you what you need. He tells you to use map and str to make an
array of strings:
   data5 = map( str, data4 )

On second thought though, the easiest (read: the quickest, and
not necessarily the best) way to make this work (if print data4 works the
way I think it does anyway) would be to just change "line" to
"line.__str__()" in the line.replace line of code. So it will read
"line.__str__().replace('[', ' ').replace(']', ' ').

This will give you the string representation of the line object (essentially
the same thing as calling "print line").

Ryan A

On Thu, Mar 11, 2010 at 12:20 PM, <lintzh at science.oregonstate.edu> wrote:

> Ryan, am I supposed to reply to the user group or just to you?
> I'm using NumArray because I need the ArcGISscripting module, which is
> written in python 2.5. Numpy is for later versions.
>
> I tried various permutations of the tolist() and tofile() funciotns you
> pointed out but they didn't work.
>
> Do you know if there a way to write a 2D array to a data file without
> NumArray if you are starting with a list of say 10 numbers?
>
> Or, can you reshape that list (of 0 through 9) to be 2 rows and 5 columns
> and write it as such without NumArray?
>
> Thank you,
> Heather
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/portland/attachments/20100311/48e618af/attachment.html>


More information about the Portland mailing list