Skip to content

Commit f16ee45

Browse files
committed
made changes
1 parent 81f14fe commit f16ee45

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

1_Array_creation_routines.ipynb

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,26 @@
385385
},
386386
{
387387
"cell_type": "code",
388-
"execution_count": 10,
388+
"execution_count": 30,
389389
"metadata": {
390390
"collapsed": false
391391
},
392-
"outputs": [],
392+
"outputs": [
393+
{
394+
"data": {
395+
"text/plain": [
396+
"matrix([[1, 2],\n",
397+
" [3, 4]])"
398+
]
399+
},
400+
"execution_count": 30,
401+
"metadata": {},
402+
"output_type": "execute_result"
403+
}
404+
],
393405
"source": [
394-
"X = np.array([[1, 2], [3, 4]])\n"
406+
"X = np.array([[1, 2], [3, 4]])\n",
407+
"np.asmatrix(X)"
395408
]
396409
},
397410
{
@@ -403,13 +416,27 @@
403416
},
404417
{
405418
"cell_type": "code",
406-
"execution_count": 11,
419+
"execution_count": null,
407420
"metadata": {
408421
"collapsed": false
409422
},
410-
"outputs": [],
423+
"outputs": [
424+
{
425+
"ename": "AttributeError",
426+
"evalue": "`np.asfarray` was removed in the NumPy 2.0 release. Use `np.asarray` with a proper dtype instead.",
427+
"output_type": "error",
428+
"traceback": [
429+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
430+
"\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)",
431+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[32]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m 1\u001b[39m x = [\u001b[32m1\u001b[39m, \u001b[32m2\u001b[39m]\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m \u001b[43mnp\u001b[49m\u001b[43m.\u001b[49m\u001b[43masfarray\u001b[49m(x)\n",
432+
"\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\Emmi\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\numpy\\__init__.py:794\u001b[39m, in \u001b[36m__getattr__\u001b[39m\u001b[34m(attr)\u001b[39m\n\u001b[32m 791\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(__former_attrs__[attr], name=\u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m 793\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m attr \u001b[38;5;129;01min\u001b[39;00m __expired_attributes__:\n\u001b[32m--> \u001b[39m\u001b[32m794\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\n\u001b[32m 795\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m`np.\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mattr\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m` was removed in the NumPy 2.0 release. \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 796\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m__expired_attributes__[attr]\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m\"\u001b[39m,\n\u001b[32m 797\u001b[39m name=\u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 798\u001b[39m )\n\u001b[32m 800\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m attr == \u001b[33m\"\u001b[39m\u001b[33mchararray\u001b[39m\u001b[33m\"\u001b[39m:\n\u001b[32m 801\u001b[39m warnings.warn(\n\u001b[32m 802\u001b[39m \u001b[33m\"\u001b[39m\u001b[33m`np.chararray` is deprecated and will be removed from \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 803\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mthe main namespace in the future. Use an array with a string \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 804\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mor bytes dtype instead.\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;167;01mDeprecationWarning\u001b[39;00m, stacklevel=\u001b[32m2\u001b[39m)\n",
433+
"\u001b[31mAttributeError\u001b[39m: `np.asfarray` was removed in the NumPy 2.0 release. Use `np.asarray` with a proper dtype instead."
434+
]
435+
}
436+
],
411437
"source": [
412-
"x = [1, 2]\n"
438+
"x = [1, 2]\n",
439+
"np.asfarr"
413440
]
414441
},
415442
{

0 commit comments

Comments
 (0)