Skip to content
murmot

Results for “python numpy array example program code site:mail.python.org box”

  • mail.python.org

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

    The array object ~~~~~~~~~~~~~~~~ Regarding the array object implementation, we plan to start with a regular Python class that wraps a ``numpy.ndarray`` instance. Attributes and methods can forward to that wrapped instance, applying input validation and implementing changed behaviour as needed.

  • 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).answer = array([ 5,6,7,8,9]).

  • mail.python.org

    [Tutor] 2-D array to string - Python

    Thank you very much Evert. Starting from your advice, I used: a=numpy.array ( [ [100,2,3], [4,5,6], [7,8,9]]) s=repr (a).replace ('array',' ') s=' '+''.join ( [ c for c in s if c not in (' (', ')',' [',']',',')]) print s This gave the correct result. So, the problem is solved. The reason I wanted the array to be converted to string format is that I use such strings as an input to another ...

  • mail.python.org

    [Numpy-discussion] A random.normal function with stdev as array

    Next message (by thread): [Numpy-discussion] A random.normal function with stdev as array.An object array is created and the function is called for every element. This object array is then converted to a number type after the fact. The segfault should be tracked down in any case.

  • mail.python.org

    [Matrix-SIG] Reading binary data from file into NumPy arrays ...

    Jun 18, 1998 · Hello all, I needed a relatively low-level method to load arbitrary binary data files into NumPy arrays, so I wrote C-extension code to do it after learning a little about the NumPy API through the source code. I've called the module numpyio and it allows reading and writing aribrary data-types to an open file stream.

  • 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

    [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

    [Numpy-discussion] ragged array implimentation

    and returns > numpy object arrays, where the elements of the object arrays are > themselves 1d numpy arrays. I don't think there is any other way to do > it. In your example, the 'ragged' array would be a 1d numpy array with > dtype='O'...

  • mail.python.org

    [Numpy-discussion] CorePy 1.0 Release (x86, Cell BE, BSD!)

    CorePy is a > complete system for developing machine-level programs in Python. > CorePy lets developers build and execute assembly-level programs > interactively from the Python command prompt, embed them directly in > Python applications, or export them to standard assembly languages. > > CorePy's straightforward APIs enable the creation of ...

  • mail.python.org

    [Tutor] maximum value in a Numeric array - Python

    Dec 10, 2004 · Are you using numarray? If so, there appears to be a max method of an array, so you can try b = array ( [ [1,2], [3,4]]) b.max () Note that your method of finding the max row, then finding the max in the row, will not in general give the correct result.