add solution with matrix-mult operator
This solution work for Python 3.5 and above.
This commit is contained in:
@@ -208,6 +208,10 @@ color = np.dtype([("r", np.ubyte, 1),
|
|||||||
```python
|
```python
|
||||||
Z = np.dot(np.ones((5,3)), np.ones((3,2)))
|
Z = np.dot(np.ones((5,3)), np.ones((3,2)))
|
||||||
print(Z)
|
print(Z)
|
||||||
|
|
||||||
|
# Alternative solution, in Python 3.5 and above
|
||||||
|
Z = np.ones((5,3)) @ np.ones((3,2))
|
||||||
|
print(Z)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 25. Given a 1D array, negate all elements which are between 3 and 8, in place. (★☆☆)
|
#### 25. Given a 1D array, negate all elements which are between 3 and 8, in place. (★☆☆)
|
||||||
|
|||||||
Reference in New Issue
Block a user