Skip to content

Commit 614fa8f

Browse files
committed
Add code to exercises where it is needed
1 parent 9933e1b commit 614fa8f

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

100 Numpy exercises no solution.ipynb

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,19 @@
275275
"#### 17. What is the result of the following expression? (★☆☆)"
276276
]
277277
},
278+
{
279+
"cell_type": "markdown",
280+
"metadata": {},
281+
"source": [
282+
"```python\n",
283+
"0 * np.nan\n",
284+
"np.nan == np.nan\n",
285+
"np.inf > np.nan\n",
286+
"np.nan - np.nan\n",
287+
"0.3 == 3 * 0.1\n",
288+
"```"
289+
]
290+
},
278291
{
279292
"cell_type": "code",
280293
"execution_count": null,
@@ -419,6 +432,19 @@
419432
"#### 26. What is the output of the following script? (★☆☆)"
420433
]
421434
},
435+
{
436+
"cell_type": "markdown",
437+
"metadata": {},
438+
"source": [
439+
"```python\n",
440+
"# Author: Jake VanderPlas\n",
441+
"\n",
442+
"print(sum(range(5),-1))\n",
443+
"from numpy import *\n",
444+
"print(sum(range(5),-1))\n",
445+
"```"
446+
]
447+
},
422448
{
423449
"cell_type": "code",
424450
"execution_count": null,
@@ -435,6 +461,20 @@
435461
"#### 27. Consider an integer vector Z, which of these expressions are legal? (★☆☆)"
436462
]
437463
},
464+
{
465+
"cell_type": "markdown",
466+
"metadata": {},
467+
"source": [
468+
"```python\n",
469+
"Z**Z\n",
470+
"2 << Z >> 2\n",
471+
"Z <- Z\n",
472+
"1j*Z\n",
473+
"Z/1/1\n",
474+
"Z<Z>Z\n",
475+
"```"
476+
]
477+
},
438478
{
439479
"cell_type": "code",
440480
"execution_count": null,
@@ -451,6 +491,17 @@
451491
"#### 28. What are the result of the following expressions?"
452492
]
453493
},
494+
{
495+
"cell_type": "markdown",
496+
"metadata": {},
497+
"source": [
498+
"```python\n",
499+
"np.array(0) / np.array(0)\n",
500+
"np.array(0) // np.array(0)\n",
501+
"np.array([np.nan]).astype(int).astype(float)\n",
502+
"```"
503+
]
504+
},
454505
{
455506
"cell_type": "code",
456507
"execution_count": null,
@@ -515,6 +566,15 @@
515566
"#### 32. Is the following expressions true? (★☆☆)"
516567
]
517568
},
569+
{
570+
"cell_type": "markdown",
571+
"metadata": {},
572+
"source": [
573+
"```python\n",
574+
"np.sqrt(-1) == np.emath.sqrt(-1)\n",
575+
"```"
576+
]
577+
},
518578
{
519579
"cell_type": "code",
520580
"execution_count": null,
@@ -867,6 +927,17 @@
867927
"#### 54. How to read the following file? (★★☆)"
868928
]
869929
},
930+
{
931+
"cell_type": "markdown",
932+
"metadata": {},
933+
"source": [
934+
"```\n",
935+
"1, 2, 3, 4, 5\n",
936+
"6, , , 7, 8\n",
937+
" , , 9,10,11\n",
938+
"```"
939+
]
940+
},
870941
{
871942
"cell_type": "code",
872943
"execution_count": null,

0 commit comments

Comments
 (0)