Gael Varoquaux wrote:
> On Tue, Feb 17, 2009 at 10:18:11AM -0600, Robert Kern wrote:
>> On Tue, Feb 17, 2009 at 10:16, Gael Varoquaux
>> wrote:
>>> On Tue, Feb 17, 2009 at 09:09:38AM -0600, Robert Kern wrote:
np.repeat(np.repeat(x, 2, axis=0), 2, axis=1)
>
stride_tricks are fun, but thi
On Tue, Feb 17, 2009 at 09:09:38AM -0600, Robert Kern wrote:
> np.repeat(np.repeat(x, 2, axis=0), 2, axis=1)
> stride_tricks are fun, but this is already a solved problem in numpy.
Wow. I still have a lot to learn! How about adding a see-also in
as_strided.
Gaël
_
On Tue, Feb 17, 2009 at 10:18:11AM -0600, Robert Kern wrote:
> On Tue, Feb 17, 2009 at 10:16, Gael Varoquaux
> wrote:
> > On Tue, Feb 17, 2009 at 09:09:38AM -0600, Robert Kern wrote:
> >> np.repeat(np.repeat(x, 2, axis=0), 2, axis=1)
> >> stride_tricks are fun, but this is already a solved proble
On Tue, Feb 17, 2009 at 10:16, Gael Varoquaux
wrote:
> On Tue, Feb 17, 2009 at 09:09:38AM -0600, Robert Kern wrote:
>> np.repeat(np.repeat(x, 2, axis=0), 2, axis=1)
>
>> stride_tricks are fun, but this is already a solved problem in numpy.
>
> Wow. I still have a lot to learn! How about adding a s
2009/2/17 Robert Kern :
>> To get back to the fun part: I see now the zoomed view is not a view
>> but a new array. How do we get around that?
>
> You can't. numpy's memory model simply cannot represent that permutation.
Right, something like the PIL's pointer-to-pointers format.
I should have
On Tue, Feb 17, 2009 at 09:21, Stéfan van der Walt wrote:
> 2009/2/17 Robert Kern :
>> stride_tricks are fun, but this is already a solved problem in numpy.
>
> To get back to the fun part: I see now the zoomed view is not a view
> but a new array. How do we get around that?
You can't. numpy's
2009/2/17 Robert Kern :
> stride_tricks are fun, but this is already a solved problem in numpy.
To get back to the fun part: I see now the zoomed view is not a view
but a new array. How do we get around that?
Cheers
Stéfan
___
Numpy-discussion mailing
On Tue, Feb 17, 2009 at 09:15, wrote:
> I'm still learning about views:
>
b = np.repeat(np.repeat(a, 2, axis=0), 2, axis=1)
b.flags
> C_CONTIGUOUS : True
> F_CONTIGUOUS : False
> OWNDATA : True
> WRITEABLE : True
> ALIGNED : True
> UPDATEIFCOPY : False
>
> Does OWNDATA : True me
Tue, 17 Feb 2009 10:15:19 -0500, josef.pktd wrote:
[clip]
> I'm still learning about views:
[clip: c = foo(a); c.flags.owndata]
> Does OWNDATA : True mean it made a copy?
Yes. But owndata==False does not mean no copy was made (since the result
could be a view to a temporary array).
> Or is the
On Tue, Feb 17, 2009 at 10:09 AM, Robert Kern wrote:
> On Tue, Feb 17, 2009 at 08:44, Gael Varoquaux
> wrote:
>> On Tue, Feb 17, 2009 at 04:42:21PM +0200, Stéfan van der Walt wrote:
>>> Or, more generally:
>>
>>> import numpy as np
>>
>>> def zoom(x, factor=2):
>>> rows, cols = x.shape
>>
On Tue, Feb 17, 2009 at 08:44, Gael Varoquaux
wrote:
> On Tue, Feb 17, 2009 at 04:42:21PM +0200, Stéfan van der Walt wrote:
>> Or, more generally:
>
>> import numpy as np
>
>> def zoom(x, factor=2):
>> rows, cols = x.shape
>> row_stride, col_stride = x.strides
>> view = np.
On Tue, Feb 17, 2009 at 10:01 AM, Gael Varoquaux
wrote:
> On Tue, Feb 17, 2009 at 04:58:57PM +0200, Stéfan van der Walt wrote:
>> 2009/2/17 Gael Varoquaux :
>> > That's handy, you should commit this somewhere. Actually, it would be
>> > even cooler if you could have different zoom factor in differ
On Tue, Feb 17, 2009 at 9:44 AM, Gael Varoquaux
wrote:
> On Tue, Feb 17, 2009 at 04:42:21PM +0200, Stéfan van der Walt wrote:
>> Or, more generally:
>
>> import numpy as np
>
>> def zoom(x, factor=2):
>> rows, cols = x.shape
>> row_stride, col_stride = x.strides
>> view = n
On Tue, Feb 17, 2009 at 04:58:57PM +0200, Stéfan van der Walt wrote:
> 2009/2/17 Gael Varoquaux :
> > That's handy, you should commit this somewhere. Actually, it would be
> > even cooler if you could have different zoom factor in different
> > direction :).
> Something like this:
> a = np.array(
2009/2/17 Gael Varoquaux :
> That's handy, you should commit this somewhere. Actually, it would be
> even cooler if you could have different zoom factor in different
> direction :).
Something like this:
a = np.array([[1, 2, 3],
[4, 5, 6]])
print a
print zoom(a, x=2, y=3)
[[1 2 3]
On Tue, Feb 17, 2009 at 04:42:21PM +0200, Stéfan van der Walt wrote:
> Or, more generally:
> import numpy as np
> def zoom(x, factor=2):
> rows, cols = x.shape
> row_stride, col_stride = x.strides
> view = np.lib.stride_tricks.as_strided(x,
> (rows,
2009/2/17 Stéfan van der Walt :
> 2009/2/17 Vincent Schut :
>> Hi list,
>>
>> would it be possible to create a view on an array, such that this view
>> is twice as large (in some dimensions) and in fact does a nearest
>> neighbour 'zoom' on the original array? E.g. using some fancy
>> slicing/strid
Hi Vincent
2009/2/17 Vincent Schut :
> Hi list,
>
> would it be possible to create a view on an array, such that this view
> is twice as large (in some dimensions) and in fact does a nearest
> neighbour 'zoom' on the original array? E.g. using some fancy
> slicing/striding tricks?
>
> an example:
On Tue, Feb 17, 2009 at 5:04 AM, Vincent Schut wrote:
> Hi list,
>
> would it be possible to create a view on an array, such that this view
> is twice as large (in some dimensions) and in fact does a nearest
> neighbour 'zoom' on the original array? E.g. using some fancy
> slicing/striding tricks?
Hi list,
would it be possible to create a view on an array, such that this view
is twice as large (in some dimensions) and in fact does a nearest
neighbour 'zoom' on the original array? E.g. using some fancy
slicing/striding tricks?
an example:
a = [[1, 2],
[3, 4]]
then I'd like a view
20 matches
Mail list logo