Wed May 10 03:06:00 UTC 2023 inscode

上级 aa1305a2
......@@ -20,16 +20,109 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "91ef11b2-a866-4084-9f9c-9433a12ba191",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"100\n"
]
}
],
"source": [
"print(100)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "6c0f0083",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[1 4 7]\n",
" [2 5 8]\n",
" [3 6 9]]\n",
"Transposed Array:\n",
" [[1 4 7]\n",
" [2 5 8]\n",
" [3 6 9]]\n",
"Array Shape: (3, 3)\n",
"Array Data Type: int64\n",
"Array Element Size: 8\n",
"Array Total Size: 72\n",
"Element at 1st Row 2nd Column: 2\n",
"Elements from 1st and 2nd Row, and 1st and 2nd Column:\n",
" [[1 2]\n",
" [4 5]]\n",
"Sum of Array Elements: 45\n",
"Average of Array Elements: 5.0\n",
"Maximum Element in Array: 9\n",
"Minimum Element in Array: 1\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"# 生成一个 3x3 的二维数组\n",
"arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n",
"\n",
"# 转置数组\n",
"transposed_arr = arr.T\n",
"print(transposed_arr)\n",
"import numpy as np\n",
"\n",
"# 生成一个 3x3 的二维数组\n",
"arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n",
"\n",
"# 转置数组\n",
"transposed_arr = arr.T\n",
"print(\"Transposed Array:\\n\", transposed_arr)\n",
"\n",
"# 数组的形状\n",
"print(\"Array Shape:\", arr.shape)\n",
"\n",
"# 数组的类型\n",
"print(\"Array Data Type:\", arr.dtype)\n",
"\n",
"# 数组元素的字节大小\n",
"print(\"Array Element Size:\", arr.itemsize)\n",
"\n",
"# 数组元素的总字节大小\n",
"print(\"Array Total Size:\", arr.nbytes)\n",
"\n",
"# 访问数组的某个元素\n",
"print(\"Element at 1st Row 2nd Column:\", arr[0][1])\n",
"\n",
"# 访问数组的某个区域\n",
"print(\"Elements from 1st and 2nd Row, and 1st and 2nd Column:\\n\", arr[:2, :2])\n",
"\n",
"# 对数组求和、平均值、最大值、最小值\n",
"print(\"Sum of Array Elements:\", arr.sum())\n",
"print(\"Average of Array Elements:\", arr.mean())\n",
"print(\"Maximum Element in Array:\", arr.max())\n",
"print(\"Minimum Element in Array:\", arr.min())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "27161d42",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
......@@ -44,6 +137,11 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
},
"vscode": {
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}
}
},
"nbformat": 4,
......
anyio==3.6.2
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
astroid==2.15.4
asttokens==2.2.1
attrs==23.1.0
autopep8==1.5.5
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.2
bleach==6.0.0
certifi==2019.11.28
cffi==1.15.1
chardet==3.0.4
charset-normalizer==3.1.0
comm==0.1.3
dbus-python==1.2.16
debugpy==1.6.7
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.6
distro-info===0.23ubuntu1
docopt==0.6.2
executing==1.2.0
fastjsonschema==2.16.3
flake8==3.8.4
idna==2.8
importlib-metadata==6.6.0
importlib-resources==5.12.0
ipykernel==6.23.0
ipython==8.12.2
ipython-genutils==0.2.0
isort==5.12.0
jedi==0.17.2
Jinja2==3.1.2
json5==0.9.11
jsonschema==4.17.3
jupyter-lsp==2.1.0
jupyter-server==1.24.0
jedi==0.18.2
jupyter_client==8.2.0
jupyter_core==5.3.0
jupyterlab==3.2.0
jupyterlab-pygments==0.2.2
jupyterlab_server==2.22.1
lazy-object-proxy==1.9.0
MarkupSafe==2.1.2
matplotlib-inline==0.1.6
mccabe==0.6.1
mistune==2.0.5
nbclassic==0.5.6
nbclient==0.7.4
nbconvert==7.4.0
nbformat==5.8.0
nest-asyncio==1.5.6
notebook_shim==0.2.3
numpy==1.24.3
packaging==23.1
pandocfilters==1.5.0
parso==0.7.1
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
pipreqs==0.4.13
pkgutil_resolve_name==1.3.10
platformdirs==3.5.0
pluggy==1.0.0
prometheus-client==0.16.0
prompt-toolkit==3.0.38
psutil==5.9.5
ptyprocess==0.7.0
pure-eval==0.2.2
pycodestyle==2.6.0
pycparser==2.21
pydocstyle==6.3.0
pyflakes==2.2.0
Pygments==2.15.1
PyGObject==3.36.0
pylint==2.17.4
pyrsistent==0.19.3
python-apt==2.0.1+ubuntu0.20.4.1
python-dateutil==2.8.2
python-jsonrpc-server==0.4.0
python-language-server==0.36.2
pytoolconfig==1.2.5
pytz==2023.3
pyzmq==25.0.2
requests==2.30.0
requests==2.22.0
requests-unixsocket==0.2.0
rope==1.8.0
Send2Trash==1.8.2
six==1.14.0
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.4.1
stack-data==0.6.2
terminado==0.17.1
tinycss2==1.2.1
toml==0.10.2
tomli==2.0.1
tomlkit==0.11.8
tornado==6.3.1
traitlets==5.9.0
typing_extensions==4.5.0
ujson==5.7.0
unattended-upgrades==0.1
urllib3==1.25.8
wcwidth==0.2.6
webencodings==0.5.1
websocket-client==1.5.1
wrapt==1.15.0
yapf==0.33.0
yarg==0.1.9
zipp==3.15.0
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"100\n"
]
}
],
"source": [
"print(100)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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",
"version": "3.8.10"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册