Python:numpy command

Import numpy as np

Create a matrix:
A = np.array([[elements of row1], [element of row2], ... ])

A = np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]])
A= 123 234 345 456

Sub-matrix
B = A[[select row], select column]

B = A[[0, 2], 1:]
B=[24 35 46 ]

Comments

Popular posts from this blog

การใช้ MATLAB ย้ายข้างสมการ

การตั้งค่า Raspberry Pi 3 เพื่อเชื่อมต่อ RS485

การสร้างหน้า google maps ใน ionic slide menu