Home > Backend Development > Python Tutorial > Examples of numpy array splicing, merging rows and columns respectively

Examples of numpy array splicing, merging rows and columns respectively

不言
Release: 2018-05-08 16:13:07
Original
3325 people have browsed it

This article mainly introduces examples of array splicing in numpy, merging rows and columns respectively. It has a certain reference value. Now I share it with you. Friends in need can refer to it

When performing data analysis, will some sample data with multiple characteristics be spliced ​​and merged, analyzed together, and predicted....

The following is an array using functions in numpy of splicing.

(1) Method one. np.vstack() v means vertical, that is, vertical splicing and np.hstack() h means Horizontal

(2) Method 2, np.c_[array1,array2] c_represents the column column np.r_[array1,array2] r_represents the row row

Related recommendations:

numpy’s extension method for merging multi-dimensional matrices and lists

How to implement it Delete rows or columns in numpy.array

The above is the detailed content of Examples of numpy array splicing, merging rows and columns respectively. 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