Merge pull request #21 from ibah/master

detail: improved readability for 'point by point distances' exercise
This commit is contained in:
Nicolas P. Rougier
2016-09-09 12:30:00 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -1076,7 +1076,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"Z = np.random.random((10,2))\n", "Z = np.random.random((10,2))\n",
"X,Y = np.atleast_2d(Z[:,0]), np.atleast_2d(Z[:,1])\n", "X,Y = np.atleast_2d(Z[:,0], Z[:,1])\n",
"D = np.sqrt( (X-X.T)**2 + (Y-Y.T)**2)\n", "D = np.sqrt( (X-X.T)**2 + (Y-Y.T)**2)\n",
"print(D)\n", "print(D)\n",
"\n", "\n",

View File

@@ -498,7 +498,7 @@ print(Z)
```python ```python
Z = np.random.random((10,2)) Z = np.random.random((10,2))
X,Y = np.atleast_2d(Z[:,0]), np.atleast_2d(Z[:,1]) X,Y = np.atleast_2d(Z[:,0], Z[:,1])
D = np.sqrt( (X-X.T)**2 + (Y-Y.T)**2) D = np.sqrt( (X-X.T)**2 + (Y-Y.T)**2)
print(D) print(D)