Hi All,
An issue [1] about the copying of arrays with structured dtype raised a
question about what the expected behaviour is: does copy always preserve
the dtype as is, or should it remove padding?
Specifically, consider an array with a structure with many fields, say 'a'
to 'z'. Since numpy 1.1
On Tue, Apr 9, 2019 at 6:25 PM Ralf Gommers wrote:
>
>
> Thanks Alan, good questions. The donations via the Flipcause site go to
> NumFOCUS. NumFOCUS is a 501(c)3 and NumPy's fiscal sponsor, so any
> individual or institution that wants to donate to NumPy should preferably
> donate to NumFOCUS. T
Hi Marten,
On Thu, 11 Apr 2019 09:51:10 -0400, Marten van Kerkwijk wrote:
> From the discussion so far, it
> seems the logic has boiled down to a choice between:
>
> (1) Copy is a contract that the dtype will not vary (e.g., we also do not
> change endianness);
>
> (2) Copy is a contract that an
I agree with Stefan that option 2 is what NumPy should go with for .copy()
If you want to get an identical memory copy you should be getting the .data
attribute and doing something with that buffer.
My $0.02
-Travis
On Thu, Apr 11, 2019 at 6:01 PM Stefan van der Walt
wrote:
> Hi Marten,
>
>
My concern would be that to implement (2), I think .copy() has to
either special-case certain dtypes, or else we have to add some kind
of "simplify for copy" operation to the dtype protocol. These both add
architectural complexity, so maybe it's better to avoid it unless we
have a compelling reason