Skip to content

Commit c0a8c3f

Browse files
committed
completed numpy and pandas notebooks
1 parent 0a58b1f commit c0a8c3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

notebooks/02_NumPy.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@
900900
"colab_type": "text"
901901
},
902902
"source": [
903-
"### Pitfalls of careless reshaping"
903+
"### Unintended reshaping"
904904
]
905905
},
906906
{
@@ -950,7 +950,6 @@
950950
}
951951
},
952952
"source": [
953-
"# Pitfalls of careless reshaping\n",
954953
"x = np.array([[[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]],\n",
955954
" [[10, 10, 10, 10], [20, 20, 20, 20], [30, 30, 30, 30]]])\n",
956955
"print (\"x:\\n\", x)\n",
@@ -999,6 +998,7 @@
999998
}
1000999
},
10011000
"source": [
1001+
"# Unintended reshaping\n",
10021002
"z_incorrect = np.reshape(x, (x.shape[1], -1))\n",
10031003
"print (\"z_incorrect:\\n\", z_incorrect)\n",
10041004
"print (\"z_incorrect.shape: \", z_incorrect.shape)"
@@ -1042,6 +1042,7 @@
10421042
}
10431043
},
10441044
"source": [
1045+
"# Intended reshaping\n",
10451046
"y = np.transpose(x, (1,0,2))\n",
10461047
"print (\"y:\\n\", y)\n",
10471048
"print (\"y.shape: \", y.shape)\n",

0 commit comments

Comments
 (0)