From d8d5e3de0447f18dd8e89e864af72dcedf3fee47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=9D=82=E6=98=B4?= Date: Sun, 29 Sep 2024 11:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/2024,09,29/test1.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/2024,09,29/test1.py diff --git a/test/2024,09,29/test1.py b/test/2024,09,29/test1.py new file mode 100644 index 0000000..f5880d3 --- /dev/null +++ b/test/2024,09,29/test1.py @@ -0,0 +1,7 @@ +# 练习题1: 创建指定形状和数据类型的NumPy数组 +# 题目: 创建一个形状为(3, 4),数据类型为float32的NumPy数组,其元素值从1到12线性递增。 + +import numpy as np + +a = np.arange(1, 13, dtype=np.float32).reshape(3, 4) +print(a)