A is a matrix of size nx2n ,and I'm trying to write a Python code that will return the list v without using a for loop using numpy functions.
Asked
Active
Viewed 25 times
0
-
1This question is better suited for stack overflow – ab123 Sep 16 '19 at 07:29
1 Answers
1
li = [A[i][2*i] + A[i][2*i + 1] for i in range(n)]
ab123
- 2,521
-
-
-
-
-
1@user3133165 I can't say for sure. You should ask on Stack Overflow. Also, even if you do get such a method, it might internally use
foror its equivalent – ab123 Sep 16 '19 at 08:38