lundi 13 février 2017

How can I add a different-sized matrix to another one on Python?

Vote count: 0

So, I spent some time looking around but did not quite find the answer I was looking for. I have two files of data, data1 and data2, that i've imported from txt's.

Each one is a matrix, data 1 has N1 rows and 2 columns, and data2 has N2 rows and 2 columns as well. Note that N1 is not equal to N2. I would like to make a third matrix, data3, with the first two columns being the two from data1, and the two other columns being those from data2 . Also, they should have same length (that is, we must force N1 = N2 by eliminating the exceeding entries on the matrix that is larger).

To sum it up: In this case we should get a matrix N by 4, where N is min(N1,N2).

Any one could help? :)

asked 24 secs ago

Let's block ads! (Why?)



How can I add a different-sized matrix to another one on Python?

Aucun commentaire:

Enregistrer un commentaire