Skip to content
murmot

Results for “function return python array java object string example site:numpy.org 1”

  • numpy.org

    Array API — NumPy v1.19 Manual

    This is the main array creation function. Most new arrays are created with this flexible function. The returned object is an object of Python-type subtype, which must be a subtype of PyArray_Type. The array has nd dimensions, described by dims.

  • numpy.org

    Subclassing ndarray — NumPy v2.5 Manual

    The second is the use of the __array_finalize__ method to allow subclasses to clean up after the creation of views and new instances from templates. A brief Python primer on __new__ and __init__ # __new__ is a standard Python method, and, if present, is called before __init__ when we create a class instance.

  • numpy.org

    Indexing on ndarrays — NumPy v2.5 Manual

    Most of the following examples show the use of indexing when referencing data in an array. The examples work just as well when assigning to an array. See Assigning values to indexed arrays for specific examples and explanations on how assignments work.

  • numpy.org

    numpy.array2string — NumPy v2.5 Manual

    Notes If a formatter is specified for a certain type, the precision keyword is ignored for that type. This is a very flexible function; array_repr and array_str are using array2string internally so keywords with the same name should work identically in all three functions. Examples Try it in your browser!

  • numpy.org

    Array creation — NumPy v2.6.dev0 Manual

    Conversion from other Python structures (i.e. lists and tuples)Intrinsic NumPy array creation functions (e.g. arange, ones, zeros, etc.)Creating arrays from raw bytes through the use of strings or buffers

  • numpy.org

    Array objects — NumPy v2.5 Manual

    Figure Conceptual diagram showing the relationship between the three fundamental objects used to describe the data in an array: 1) the ndarray itself, 2) the data-type object that describes the layout of a single fixed-size element of the array, 3) the array-scalar Python object that is returned when a single element of the array is accessed. #

  • numpy.org

    Array API — NumPy v1.15 Manual

    Return an ndarray object from a Python object that exposes the __array__ method. The __array__ method can take 0, 1, or 2 arguments ([dtype, context]) where context is used to pass information about where the __array__ method is being called from (currently only used in ufuncs).

  • numpy.org

    The array interface protocol — NumPy v2.5 Manual

    The homogeneous N-dimensional array interface is a default mechanism for objects to share N-dimensional array memory and information. The interface consists of a Python-side and a C-side using two attributes. Objects wishing to be considered an N-dimensional array in application code should support at least one of these attributes.