numpy

package
v0.0.0-...-551f019 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexedValues

func IndexedValues[T any](a *Array) iter.Seq2[[]int, T]

func Values

func Values[T any](a *Array) iter.Seq[T]

Types

type Array

type Array struct {
	// contains filtered or unexported fields
}

func AsArray

func AsArray(ptr unsafe.Pointer) *Array

func (*Array) At

func (a *Array) At(idxs ...int) interface{}

func (*Array) Bytes

func (a *Array) Bytes() (unsafe.Pointer, uint64)

func (*Array) Dims

func (a *Array) Dims() int

The number of dimensions in the array.

func (*Array) IndexedValues

func (a *Array) IndexedValues() iter.Seq2[[]int, interface{}]

func (*Array) PyArrayObject

func (a *Array) PyArrayObject() *C.PyArrayObject

func (*Array) PyObject

func (a *Array) PyObject() unsafe.Pointer

func (*Array) SetAt

func (a *Array) SetAt(v interface{}, idxs ...int)

func (*Array) Shape

func (a *Array) Shape() []int

Returns a slice of the dimensions/shape of the array. The number of elements matches the number of dimensions of the array. Can return nil for 0-dimensional arrays.

func (*Array) Size

func (a *Array) Size() int

Returns the total size (in number of elements) of the array.

func (*Array) Type

func (a *Array) Type() NumpyType

Return the (builtin) typenumber for the elements of this array.

func (*Array) Values

func (a *Array) Values() iter.Seq[interface{}]

type NumpyType

type NumpyType int
const (
	NPY_BOOL        NumpyType = C.NPY_BOOL
	NPY_BYTE        NumpyType = C.NPY_BYTE
	NPY_UBYTE       NumpyType = C.NPY_UBYTE
	NPY_SHORT       NumpyType = C.NPY_SHORT
	NPY_USHORT      NumpyType = C.NPY_USHORT
	NPY_INT         NumpyType = C.NPY_INT
	NPY_UINT        NumpyType = C.NPY_UINT
	NPY_LONG        NumpyType = C.NPY_LONG
	NPY_ULONG       NumpyType = C.NPY_ULONG
	NPY_LONGLONG    NumpyType = C.NPY_LONGLONG
	NPY_ULONGLONG   NumpyType = C.NPY_ULONGLONG
	NPY_FLOAT       NumpyType = C.NPY_FLOAT
	NPY_DOUBLE      NumpyType = C.NPY_DOUBLE
	NPY_LONGDOUBLE  NumpyType = C.NPY_LONGDOUBLE
	NPY_CFLOAT      NumpyType = C.NPY_CFLOAT
	NPY_CDOUBLE     NumpyType = C.NPY_CDOUBLE
	NPY_CLONGDOUBLE NumpyType = C.NPY_CLONGDOUBLE
	NPY_OBJECT      NumpyType = C.NPY_OBJECT
	NPY_STRING      NumpyType = C.NPY_STRING
	NPY_UNICODE     NumpyType = C.NPY_UNICODE
	NPY_VOID        NumpyType = C.NPY_VOID
	NPY_DATETIME    NumpyType = C.NPY_DATETIME
	NPY_TIMEDELTA   NumpyType = C.NPY_TIMEDELTA
	NPY_HALF        NumpyType = C.NPY_HALF
)

Constants from numpy/ndarraytypes.h enum NPY_TYPES

func (NumpyType) String

func (i NumpyType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL