Re: Python arrays and sting formatting options
- From: Peter Pearson <ppearson@xxxxxxxxxxxxxxx>
- Date: 30 Sep 2008 15:31:59 GMT
On Tue, 30 Sep 2008 00:04:18 +0200, Ivan Rebori wrote:
1. Multi dimensional arrays - how do you load them in python
For example, if I had:
-------
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
-------
with "i" being the row number, "j" the column number, and "k" the ..
uhmm, well, the "group" number, how would you load this ?
If fortran90 you would just do:
do 10 k=1,2
do 20 i=1,3
read(*,*)(a(i,j,k),j=1,3)
20 continue
10 continue
How would the python equivalent go ?
Since you're coming from the FORTRAN world (thank you for
that stroll down Memory Lane), you might be doing scientific
computations, and so might be interested in the SciPy
package (Google scipy), which gives you arrays and matrices.
Don't expect to be able to use it without learning some Python,
though.
--
To email me, substitute nowhere->spamcop, invalid->net.
.
- Follow-Ups:
- Re: Python arrays and sting formatting options
- From: Ivan Reborin
- Re: Python arrays and sting formatting options
- From: Grant Edwards
- Re: Python arrays and sting formatting options
- References:
- Python arrays and sting formatting options
- From: Ivan Reborin
- Python arrays and sting formatting options
- Prev by Date: Re: Shed Skin (restricted) Python-to-C++ compiler 0.0.29
- Next by Date: Re: Python arrays and sting formatting options
- Previous by thread: Re: Python arrays and sting formatting options
- Next by thread: Re: Python arrays and sting formatting options
- Index(es):
Relevant Pages
|