Skip to main content

All Questions

Tagged with
0 votes
1 answer
37 views

find the largest sub matrix

the larget sub matrix with odd size import numpy as np array = np.array([[np.nan, 255, 255, 0, 0, 0, 0, 0, 255, np.nan], [np.nan, 255, 255, 255, 0, 0, 0, 0, 255, np.nan], ...
Instagram diabollic's user avatar
1 vote
1 answer
35 views

Mapping 2d point (x,y) into grid index (row,col)

I have a particular **Grid ** for robot navigation showing as so: I have scaled this by a factor of 10 to create my Environment. This is given in Cartesian coordinates I would like to map a point in ...
Sadiq's user avatar
  • 21
-1 votes
1 answer
38 views

Is there a better way to declare a numpy matrix where each element [i][j] is the result of an operation between A[i] and A[j], where A is an arange?

Basically, what I need to do is this: I have a value "n" and two different arrays "x" and "y" of arbitrary values (x,y = [a, b, c, ...]) With n, I create an arange "...
Victor Lopes's user avatar
-2 votes
1 answer
964 views

Python (numpy?) - build transformation matrix from sets of source and destination points

Let's imagine I have two sets points in a 2d Euclidean system: src = [ [722.6, 1571.4], [832, 1466], [419, 1482], [1005, 2804], <snip> ] dst = [ [35839.65, 49808.55], ...
Hal's user avatar
  • 537
-1 votes
1 answer
58 views

Turn 2D matrix with indexes (tuples) to 2D Boolean matrix (in different shape) - NumPy

I’m looking for an efficient way to make index matrix to Boolean matrix, without a loop (with NumPy). The index matrix build from tuples which represents indices. I need to build a Boolean matrix (in ...
Liri Norkin's user avatar
-1 votes
1 answer
188 views

python printing in matrix 2D array

I just want to check why I can't print all the element in the matrix? as per my knowledge this is how we write the index of this matrix did I understand it wrongly? the only thing that print is ...
Songul's user avatar
  • 45
-2 votes
1 answer
48 views

separate 3D matrix like numpy

I am converting numpy code to matlab. tensor is a 3D matrix of 6 x 2D matrices of the tensor components. This code appears to then split them back into those 6 separate 2D matrices. gxx, gxy, gxz, ...
user24007's user avatar
  • 107
0 votes
1 answer
107 views

Matrix rotation in numpy python, diffrent vector's length

I want to make a 2D game in pygame, and to do so, I want to use mathematical Matrices. Tought I'm thinking right, but I got a problem. Here it is: So I make a random point and I count length of it's ...
Janusz Piechut's user avatar
-1 votes
1 answer
250 views

Editing every value in a numpy matrix

I have a numpy matrix which I filled with data from a *.csv-file csv = np.genfromtxt (file,skiprows=22) matrix = np.matrix(csv) This is a 64x64 matrix which looks like print matrix [[...,...,....] [...
rtime's user avatar
  • 359