Posts by Purp • 43 points
3 posts
-
2
votes1
answer4081
viewsQ: How to break a list and turn it into an array in Python?
In case, I want to turn a list of a column into a 3x3 matrix in numerical order: lista =([[1], [2], [3], [4], [5], [6], [7], [8], [9]]) With the expected result: ([[7 8 9] [4 5 6] [1 2 3]])…
-
2
votes2
answers2568
viewsQ: Change the value of a number in a matrix without knowing the position (index) in Python
Hello, How do I change the value of a number in a matrix when I don’t know what its index is and there might be more than one value to change? For example, if I have the matrix: [[4,5,3,15,4],…
-
0
votes1
answer361
viewsQ: How to mount an array in python with undefined value of i and j
i am beginner in python and I am in doubt in matrix mounting. In case I did the following: import numpy as np n=3 A = np.zeros((n*n,n*n)) j= 2 i = 2 k = i+n*(j-1) a = -4 L1 = i-1+n*(j-1) a1 = 1 L2 =…