Sharedsupport / 2016-02-22-numpy.sagewsOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
import numpy as np
A = np.array([[1, 2], [3, 4]], dtype=float) B = np.array([[4, 5], [6, 7]], dtype=float)
A * B
array([[ 4., 10.], [ 18., 28.]])
A / B
array([[ 0.25 , 0.4 ], [ 0.5 , 0.57142857]])
C = matrix(RDF, 2, [1,2, 3,4]) D = matrix(RDF, 2, [4,5, 6,7])
C.numpy() * D.numpy()
array([[ 4., 10.], [ 18., 28.]])