github.com/goplus/llgo@v0.8.3/py/numpy/numpy.go (about) 1 /* 2 * Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package numpy 18 19 import ( 20 _ "unsafe" 21 22 "github.com/goplus/llgo/py" 23 ) 24 25 // https://numpy.org/doc/stable/reference/index.html#reference 26 27 // Return evenly spaced values within a given interval. 28 // 29 // numpy.arange([start, ]stop, [step, ]dtype=None, *, like=None) 30 // 31 // See https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy-arange 32 // 33 //go:linkname Arange py.arange 34 func Arange(start, stop, step, dtype *py.Object) *py.Object 35 36 // Return a new array of given shape and type, without initializing entries. 37 // 38 // numpy.empty(shape, dtype=float, order='C', *, like=None) 39 // 40 // See https://numpy.org/doc/stable/reference/generated/numpy.empty.html#numpy-empty 41 // 42 //go:linkname Empty py.empty 43 func Empty(shape, dtype, order *py.Object) *py.Object 44 45 // Return a new array of given shape and type, filled with zeros. 46 // 47 // numpy.zeros(shape, dtype=float, order='C', *, like=None) 48 // 49 // See https://numpy.org/doc/stable/reference/generated/numpy.zeros.html#numpy-zeros 50 // 51 //go:linkname Zeros py.zeros 52 func Zeros(shape, dtype, order *py.Object) *py.Object 53 54 // Create an array. 55 // 56 // numpy.array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0, like=None) 57 // 58 // See https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy-array 59 // 60 //go:linkname Array py.array 61 func Array(object, dtype *py.Object) *py.Object 62 63 // Convert the input to an array. 64 // 65 // numpy.asarray(a, dtype=None, order=None, *, like=None) 66 // 67 // See https://numpy.org/doc/stable/reference/generated/numpy.asarray.html#numpy-asarray 68 // 69 //go:linkname AsArray py.asarray 70 func AsArray(a, dtype, order *py.Object) *py.Object