# -*- 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))
# Elementwise difference; both produce the array
Python Numpy Tutorials: 数组乘法:点乘和矩阵(数组)乘法
最新推荐文章于 2026-06-26 11:36:00 发布

乘法&spm=1001.2101.3001.5002&articleId=71642209&d=1&t=3&u=e3f3bb81e6154dbea64094ac7f4d1820)
825

被折叠的 条评论
为什么被折叠?



