NumPy 使用

NumPy 相当于 Python 中的 MATLAB

import numpy as np

# 被除数数组
dividends = np.array([10, 20, 30, 40, 50])

# 除数数组
divisors = np.array([2, 4, 5, 8, 10])

# 计算商
quotients = dividends / divisors

print("被除数数组:", dividends)
print("除数数组:", divisors)
print("商数组:", quotients)
posted @ 2024-06-08 23:13  Undefined443  阅读(2)  评论(0编辑  收藏  举报