Python Forum
Array to construct matrix
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array to construct matrix
#1
Hi guys,

I have 3 arrays with 10 elements which I used numpy to create:

Array 1    Array 2    Array 3
    1              2             3
    1              2             3
    1              2             3
    1              2             3
    .               .              .
    .               .              .
    .               .              .


I'd like to construct a matrix 3x10 with these arrays used as columns:

|1  2  3|
|1  2  3|
|1  2  3|
|.   .   . |
|.   .   . |
|.   .   . |

In MatLab I can do this with this command: Matrix = [Array1, Array2, Array3].

I tried something similar in Python 3.5.2 but I received the type "List". I appreciate the help.

Hi guys,

I found a solution using "np.column_stack".

In the address below, I found helpful information to those who wants to migrate from MatLab to Python. XD
https://docs.scipy.org/doc/numpy-dev/use...users.html
Reply
#2
Thanks for posting back the solution!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating look up table/matrix from 3d data array chai0404 3 2,824 Apr-09-2020, 04:53 AM
Last Post: buran
  sequential sampling from an array to a matrix nsansen 1 1,957 Mar-29-2020, 08:15 PM
Last Post: deanhystad
  advice needed to construct queries in flask-sqlalchemy from mysql select pascale 0 1,732 Dec-08-2019, 07:03 AM
Last Post: pascale
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,926 Apr-09-2019, 04:54 PM
Last Post: PhysChem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020