# -*- coding: utf-8 -*-
"""
Python Version: 3.5
Created on Thu May 11 16:51:20 2017
E-mail: Eric2014_Lv@sjtu.edu.cn
@author: DidiLv
"""
import numpy as np
x = np.array([[1,2],[3,4]], dtype=np.float64)
y = np.array([[5,6],[7,8]], dtype=np.float64)
# Elementwise sum; both produce the array
# [[ 6.0 8.0]
# [10.0 12.0]]
print(x + y)
print(np.add(x, y))
# Elementwi
Python Numpy Tutorials: 数组乘法:点乘和矩阵(数组)乘法
最新推荐文章于 2024-08-27 13:17:55 发布