add cut and split

This commit is contained in:
2022-11-05 15:18:14 +08:00
parent 8e3d535391
commit 1ff85cfa8b
3 changed files with 153 additions and 11 deletions

View File

@@ -134,12 +134,22 @@
"功能: 生成[0,1)之间的浮点数通过size参数来指定维数。\n",
"说明:\n",
"size : int or tuple of ints, optional.\n",
"Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. "
"Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. \n",
"\n",
"4. numpy.random.rand()\n",
"均匀分布\n",
"范围 [0, 1)\n",
"\n",
"5. numpy.random.normal(loc=mu, scale=sigma, size)\n",
"正态分布\n",
"mu均值\n",
"sigma标准差\n",
"size数据shape默认一个值"
]
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 25,
"metadata": {},
"outputs": [
{
@@ -148,17 +158,21 @@
"text": [
"[0 0 0 0] \n",
"\n",
"[[ 0 -2 0]\n",
" [ 1 -1 -1]] \n",
"[[ 2 1 0]\n",
" [-2 0 0]] \n",
"\n",
"0.0940234518052504 \n",
"0.9888926077885405 \n",
"\n",
"[0.58264778] \n",
"[0.32897483] \n",
"\n",
"[0.19358132 0.3565561 ] \n",
"[0.96680953 0.76946094] \n",
"\n",
"[[0.32759701 0.74016873 0.83999783]\n",
" [0.62572959 0.13477642 0.86937912]] \n",
"[[0.0936316 0.2776172 0.16938396]\n",
" [0.21494328 0.26245945 0.22463559]] \n",
"\n",
"[0.36292738 0.51118156 0.35250669] \n",
"\n",
"[[ 0.07101816 0.1111697 -0.89099377]] \n",
"\n"
]
}
@@ -176,7 +190,13 @@
"z3 = np.random.random(2) #生成1×2的数组\n",
"print(z3,\"\\n\")\n",
"z4 = np.random.random((2,3)) #生成一个2行3列的数组\n",
"print(z4,\"\\n\")"
"print(z4,\"\\n\")\n",
"\n",
"z5 = np.random.rand(3) # 生成1×3的数组\n",
"print(z5,\"\\n\")\n",
"\n",
"z6 = np.random.normal(0,1,(1,3))\n",
"print(z6,\"\\n\")"
]
}
],