Skip to content
murmot

Results for “python numpy array example program code born in site:mail.python.org in java”

  • mail.python.org

    [AstroPy] Moving Ahead with Raw Image Conversion

    In your example code, you've created a Python array of hexadecimal-valued bytes -- which I guess is what you get reading in your "raw" image, so that's OK. But you still have to convert those '\x01', etc., values to Python integers.

  • 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

    [C++-sig] numpy.ndarray did not match PyArrayObject *?

    I wrapped a c++ code which need accept numpy.ndarray as argument. > Here numpy.version='1.0rc1'. > And to the best of my knowledge, numpy.ndarray's c type is PyArrayObject. > >replace the indicated with the name of NumPy's python type object for ndarray.

  • 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

    [Tutor] inserting a vector into an array - numpy Q

    The 1-d array that's being passed in has a different dimension than the 2d array. If we trust the error message, we should make the two arrays the same dimension before we pass them to functions that glue these arrays together. We want both of them to be two-dimensional.

  • 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] 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

    [Python-Dev] Bool type and arrays

    The minute there is a bool > type in Python people will be able to make Numeric arrays (not to > mention Python arrays) with elements of type "bool". I dunno about Numeric, but you cannot use an arbitrary type for the 'array' module -- you must use one of the documented codes that tell the array module what size items to use.