numpy 基本导入

示例

导入numpy模块以使用它的任何部分。

import numpy as np

大多数示例将np用作numpy的简写。假设代码示例中的“ np”表示“ numpy”。

x = np.array([1,2,3,4])