On Wed, 2008-04-30 at 21:09 +0200, Gael Varoquaux wrote:
> On Wed, Apr 30, 2008 at 11:57:44AM -0700, Christopher Barker wrote:
> > I think I still like the idea of an iterator (or maybe making rollaxis a
> > method?), but this works pretty well.
>
> Generally, in object oriented programming, you
On Wed, Apr 30, 2008 at 3:09 PM, Gael Varoquaux
<[EMAIL PROTECTED]> wrote:
> On Wed, Apr 30, 2008 at 11:57:44AM -0700, Christopher Barker wrote:
> > I think I still like the idea of an iterator (or maybe making rollaxis a
> > method?), but this works pretty well.
>
> Generally, in object oriente
On Wed, Apr 30, 2008 at 11:57:44AM -0700, Christopher Barker wrote:
> I think I still like the idea of an iterator (or maybe making rollaxis a
> method?), but this works pretty well.
Generally, in object oriented programming, you expect a method like
rollaxis to modify an object inplace. At least
Anne Archibald wrote:
>> it's much easier to just write
>
> for subarray in np.rollaxis(A,i):
> ...
cool, thanks! So the answer to the OPs question:
> OK: how do i iterate over an axis other than 0?
>
> I have a 3D array of data[year, week, location]. I want to iterate
> over each year at
2008/4/30 Christopher Barker <[EMAIL PROTECTED]>:
> a g wrote:
> > OK: how do i iterate over an axis other than 0?
>
> This ties in nicely with some of the discussion about interating over
> matrices. It ahs been suggested that it would be nice to have iterators
> for matrices, so you could do:
a g wrote:
> OK: how do i iterate over an axis other than 0?
This ties in nicely with some of the discussion about interating over
matrices. It ahs been suggested that it would be nice to have iterators
for matrices, so you could do:
for row in M.rows:
...
and
for column in M.cols:
...
Hi Alex,
a g wrote:
> Hi. This is a very basic question, sorry if it's irritating. If i
> didn't find the answer written already somewhere on the site, please
> point me to it. That'd be great.
You should look at any of the documents below and read up on array
slicing. It is perhaps the most
2008/4/30 a g <[EMAIL PROTECTED]>:
> Hi. This is a very basic question, sorry if it's irritating. If i
> didn't find the answer written already somewhere on the site, please
> point me to it. That'd be great.
>
> OK: how do i iterate over an axis other than 0?
>
> I have a 3D array of data[y
for i in range(52):
week_data = data[:,i,:]
OR
for week_data in data.transpose(1,0,2):
...
Nadav
-הודעה מקורית-
מאת: [EMAIL PROTECTED] בשם a g
נשלח: ד 30-אפריל-08 11:11
אל: numpy-discussion@scipy.org
נושא: [Numpy-discussion] very simple iteration question.
Hi. This is a
Hi. This is a very basic question, sorry if it's irritating. If i
didn't find the answer written already somewhere on the site, please
point me to it. That'd be great.
OK: how do i iterate over an axis other than 0?
I have a 3D array of data[year, week, location]. I want to iterate
over each
10 matches
Mail list logo