improved readability for 'point by point distances', numpy.atleast_2d can take multiple arguments
This commit is contained in:
parent
04b3714fda
commit
15ede08113
@ -1076,7 +1076,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"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",
|
||||
"print(D)\n",
|
||||
"\n",
|
||||
|
@ -498,7 +498,7 @@ print(Z)
|
||||
|
||||
```python
|
||||
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)
|
||||
print(D)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user