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

Python operates matrix rows and columns

php中世界最好的语言
Release: 2018-04-09 17:07:52
Original
2888 people have browsed it

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]))
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template