This time I will bring you python to operate matrix rows and columns. What are the precautions for python to operate matrix rows and columns? Here are practical cases, let’s take a look.
Add rows to a matrix
np.row_stack() 与 np.column_stack() import numpy as np a = np.array([[4, 4,], [5, 5]]) c = np.row_stack((a, [8,9])) d = np.column_stack((a, [8,9]))
I believe you have mastered the method after reading the case in this article, more Please pay attention to other related articles on the php Chinese website!
Recommended reading:
How unittest+coverage performs unit test coverage
How does Python Unittest perform automated unit testing
The above is the detailed content of Python operates matrix rows and columns. For more information, please follow other related articles on the PHP Chinese website!