Advertisement
Korotkodul

Часть 1. Сложение массивов

Feb 17th, 2025 (edited)
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. import numpy as np
  2.  
  3. def sum_arrays_vectorized(
  4.     lhs: np.ndarray,
  5.     rhs: np.ndarray,
  6. ) -> np.ndarray:
  7.     # ваш код
  8.     if np.shape(lhs) != np.shape(rhs):
  9.         raise ValueError("ShapeMismatchError")
  10.     return lhs + rhs
  11.  
  12.  
  13. print(sum_arrays_vectorized([1, 2], [0,0,0, 0, 3]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement