Files
2024-09-24 11:40:21 +08:00

150 lines
3.0 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"id": "b3030b51-4344-419e-ac8d-6b82aadd3039",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "c30cae3d-231c-4387-ad38-45d40c548620",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1 2 3]\n"
]
}
],
"source": [
"a = np.array([1,2,3])\n",
"print(a)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "cc134d28-dde6-4379-b0c0-8fee055ee86b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 2, 3])"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "6fa02d03-4e2e-46b0-985f-1ea1ec452fdb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1, 2, 3],\n",
" [4, 5, 6]])"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a=np.array([[1,2,3],[4,5,6]])\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "f3886432-fc88-4b08-90f8-ea05108977ce",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1.+0.j, 2.+0.j, 3.+0.j],\n",
" [4.+0.j, 5.+0.j, 6.+0.j]], dtype=complex64)"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a=np.array([[1,2,3],[4,5,6]],dtype=np.complex64)\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "c020e956-5a47-4088-9d7c-278b53d48233",
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (1686139774.py, line 2)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[10], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m [4.+0.j,5.+0.j,6.+0.j]],dtype=complex64)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],
"source": [
"array=([[1.+0.j,2.+0.j,3.+0.j],\n",
" [4.+0.j,5.+0.j,6.+0.j]],dtype=complex64)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "09f5ea61-1723-4dd6-b4e6-67d8c59d7637",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.19"
}
},
"nbformat": 4,
"nbformat_minor": 5
}