Home  >  Article  >  Web Front-end  >  Python operates matrix rows and columns

Python operates matrix rows and columns

php中世界最好的语言
php中世界最好的语言Original
2018-04-09 17:07:522816browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn