Skip to content
murmot

Results for “python numpy array example api code site:mail.python.org 2”

  • mail.python.org

    [Numpy-discussion] NEP: array API standard adoption (NEP 47)

    The scope of this NEP includes: - Adopting the 2021 version of the array API standard - Adding a separate namespace, tentatively named ``numpy.array_api`` - Changes needed/desired outside of the new namespace, for example new dunder methods on the ``ndarray`` object - Implementation choices, and differences between functions in the new ...

  • mail.python.org

    [Numpy-discussion] NEP: array API standard adoption (NEP 47)

    The reason to add more than the minimum required functionality would be that it's too hard to hide the numpy-specific extras. E.g., if we'd do `np.array_api.int32 = np.int32` then that dtype would have methods and behavior that's NumPy-specific.

  • mail.python.org

    [Numpy-discussion] NEP: array API standard adoption (NEP 47)

    Feb 21, 2021 · The main > > purpose of this API is to be able to write code that is portable to > > other > > array/tensor libraries like CuPy, PyTorch, JAX, TensorFlow, Dask, and > > MXNet. > > > > We expect this NEP to remain in draft state for quite a while, while > > we're > > gaining experience with using it in downstream libraries, discuss > > adding it ...

  • mail.python.org

    [Numpy-discussion] fortran array storage question

    Previous message (by thread): [Numpy-discussion] fortran array storage question.if in that example I also change the strides: int s = tmp->strides[1]; tmp->strides[0] = s; tmp->strides[1] = s * dim0[0]; Then I get in python the fortran-style array in right order.

  • mail.python.org

    [Tutor] How to sum rows and columns of a matrix? - Python

    Feb 2, 2005 · (I'm just doodling with numarray so there may still be a better way to do this...) >>> import numarray >>> m=numarray.array (range (16),shape= (4,4)) >>> numarray.add.reduce (m) array ( [24, 28, 32, 36]) >>> numarray.add.reduce (m, axis=1) array ( [ 6, 22, 38, 54]) Kent > > >>> import numarray > > Create a 4x4 array: > >>> m=numarray.array ...

  • mail.python.org

    [Tutor] comparing two numpy arrays

    If I've two numpy arrays, is there a non-looping way of finding common > values. (the example below has identical shapes for the > arrays but this > may not be the case in my scenario) > >.Maybe convert the arrays to lists or tuples then to sets?

  • mail.python.org

    [C++-sig] numpy.int32 -> double? - Python

    Apr 28, 2009 · When I build Visual for Python 2.6 and numpy 1.3.0, I get a failure on something that works on Python 2.5 with numpy 1.2.1. There is a vector (double,double,double) class in Visual which now fails if handed numpy.int32 arguments (works fine with numpy.float64 arguments).

  • mail.python.org

    Numpy array

    This is regarding numpy array. I am a bit confused how parts of the array are being accessed in the example below. 1 import scipy as sp 2 data = sp.genfromtxt("web_traffic.tsv", delimiter="\t") 3 print(data[:10]) 4 x = data[:,0] 5 y = data[:,1].

  • mail.python.org

    [Tutor] solutions to API version mismatch - Python

    May 11, 2005 · If so, would there be any major disadvantage (s) for using an older version of Python? Or is there a simple way to update/convert the modules so that the API versions match?

  • mail.python.org

    [Tutor] Array of structures - Python

    May 22, 2001 · On Tue, 22 May 2001, Glen Barnett wrote: > Is there an equivalent Python script for the C language array of > structures? An example C program is: > =20 > struct day > { > =09char month [3]; > =09int day; > =09int year; > }; Almost. Python's list structures can hold arbitrary elements: ### >>> mylist =3D [1, "two", "iii", 4] >>> mylist [1, 'two', 'iii', 4] ### which will also allows us to ...