Files
llgo/_demo/py/matrix/matrix.go

23 lines
381 B
Go
Raw Permalink Normal View History

2024-05-15 13:49:19 +08:00
package main
import (
2025-04-03 15:52:18 +08:00
"github.com/goplus/lib/py"
"github.com/goplus/lib/py/numpy"
"github.com/goplus/lib/py/std"
2024-05-15 13:49:19 +08:00
)
func main() {
2024-05-15 14:49:00 +08:00
a := py.List(
py.List(1.0, 2.0, 3.0),
py.List(4.0, 5.0, 6.0),
py.List(7.0, 8.0, 9.0),
)
b := py.List(
py.List(9.0, 8.0, 7.0),
py.List(6.0, 5.0, 4.0),
py.List(3.0, 2.0, 1.0),
)
2024-05-15 13:49:19 +08:00
x := numpy.Add(a, b)
std.Print(py.Str("a+b ="), x)
2024-05-15 13:49:19 +08:00
}