2023-02-27 22:02:46 +08:00
|
|
|
{
|
|
|
|
"cells": [
|
2023-02-28 16:56:12 +08:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-03-14 12:53:49 +08:00
|
|
|
"execution_count": 9,
|
2023-02-28 16:56:12 +08:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
2023-03-14 12:53:49 +08:00
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"85\n",
|
|
|
|
"63\n",
|
|
|
|
"51\n",
|
|
|
|
"26\n",
|
|
|
|
"30\n",
|
|
|
|
"4\n",
|
|
|
|
"7\n",
|
|
|
|
"1\n",
|
|
|
|
"17\n",
|
|
|
|
"81\n"
|
|
|
|
]
|
2023-02-28 16:56:12 +08:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"import numpy as np\n",
|
|
|
|
"\n",
|
2023-03-14 12:53:49 +08:00
|
|
|
"np.random.randint(0.5, 3.5)\n",
|
|
|
|
"p_remove = 1\n",
|
|
|
|
"np.random.choice([True, False], p=[p_remove, 1-p_remove])\n",
|
|
|
|
"rng = np.random.default_rng(0)\n",
|
|
|
|
"for _ in range(10):\n",
|
|
|
|
" print(rng.integers(0,100))"
|
2023-02-28 16:56:12 +08:00
|
|
|
]
|
|
|
|
},
|
2023-02-27 22:02:46 +08:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "base",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
2023-03-14 12:53:49 +08:00
|
|
|
"version": "3.9.13"
|
2023-02-27 22:02:46 +08:00
|
|
|
},
|
|
|
|
"orig_nbformat": 4,
|
|
|
|
"vscode": {
|
|
|
|
"interpreter": {
|
|
|
|
"hash": "bcdafc093860683ffb58d6956591562b7f8ed5d58147d17d71a5d4d6605a08df"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|