[Numpy-discussion] ENH: Add the function 'expand_view'

Benjamin Root ben.v.root at gmail.com
Thu Nov 26 10:30:57 EST 2015


How is this different from using np.newaxis and broadcasting? Or am I
misunderstanding this?

Ben Root

On Tue, Nov 24, 2015 at 9:13 PM, <josef.pktd at gmail.com> wrote:

>
>
> On Tue, Nov 24, 2015 at 7:13 PM, Nathaniel Smith <njs at pobox.com> wrote:
>
>> On Nov 24, 2015 11:57 AM, "John Kirkham" <jakirkham at gmail.com> wrote:
>> >
>> > Takes an array and tacks on arbitrary dimensions on either side, which
>> is returned as a view always. Here are the relevant features:
>> >
>> > * Creates a view of the array that has the dimensions before and after
>> tacked on to it.
>> > * Takes the before and after arguments independent of each other and
>> the current shape.
>> > * Allows for read and write access to the underlying array.
>>
>> Can you expand this with some discussion of why you want this function,
>> and why you chose these specific features? (E.g. as mentioned in the PR
>> comments already, the reason broadcast_to returns a read-only array is that
>> it was decided that this was less confusing for users, not because of any
>> technical issue.)
>>
>
> Why is this a stride_trick?
>
> I thought this looks similar to expand_dims and could maybe be implemented
> with some extra options there.
>
>
>
> Josef
>
>
>
>> -n
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20151126/e9120e6d/attachment.html>


More information about the NumPy-Discussion mailing list