Visualize-ML / Book1_Python-For-Beginners

Book_1_《编程不难》 | 鸢尾花书:从加减乘除到机器学习;请多多批评指正!
4.55k stars 879 forks source link

Book_1_Ch_16__NumPy数组变形_Page3 #41

Closed lang07123 closed 1 year ago

lang07123 commented 1 year ago

一维数组 → 列向量 如图 2所示,利用 numpy.reshape(a, (1, -1)),我们可以把一维数组 numpy.arange(-7, 7+1) 转 化为形状为 (15, 1) 的二维数组,也称列向量,即 15 × 1 矩阵。

此处应为 numpy.reshape(a, (-1, 1)) 才可以把 shape 转为(15, 1)

Visualize-ML commented 1 year ago

谢谢你,九月份统一修改。请继续批评指正。

Cheers, James

On Tue, Jul 4, 2023 at 4:42 AM lang07123 @.***> wrote:

一维数组 → 列向量 如图 2所示,利用 numpy.reshape(a, (1, -1)),我们可以把一维数组 numpy.arange(-7, 7+1) 转 化为形状为 (15, 1) 的二维数组,也称列向量,即 15 × 1 矩阵。

此处应为 numpy.reshape(a, (-1, 1)) 才可以把 shape 转为(15, 1)

— Reply to this email directly, view it on GitHub https://github.com/Visualize-ML/Book1_Python-For-Beginners/issues/41, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHC6V3XK5VR453ZGBAROSLXOPJOTANCNFSM6AAAAAAZ5M4Q54 . You are receiving this because you are subscribed to this thread.Message ID: @.***>