[Numpy-discussion] array, asarray as contiguous and friends
oliphant at ee.byu.edu
Fri Mar 24 11:12:00 CST 2006
Alexander Belopolsky wrote:
>On 3/24/06, Tim Hochberg <tim.hochberg at cox.net> wrote:
>example (and just for
>>example, I make no great claims for either this name or interface):
>> a = array_from_data(a_buffer_object, dtype, dims, strides)
>This looks very similar to the current ndarray "new" constructor:
> | ndarray.__new__(subtype, shape=, dtype=int_, buffer=None,
> | offset=0, strides=None, fortran=False)
> | There are two modes of creating an array using __new__:
> | 1) If buffer is None, then only shape, dtype, and fortran
> | are used
> | 2) If buffer is an object exporting the buffer interface, then
> | all keywords are interpreted.
> | The dtype parameter can be any object that can be interpreted
> | as a numpy.dtype object.
>(see pydoc numpy.ndarray)
>I would not mind to leave array() unchanged and move discussion to
>streamlining ndarray.__new__ . For example, some time ago I suggested
>that strides should be interpreted even if buffer=None.
Here I'm much more happy about removing the fortran flag and just using
the strides parameter as Sasha suggests in this routine, so please
streamline as much as possible.
More information about the Numpy-discussion