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

Examples of numpy array splicing, merging rows and columns respectively

不言
不言Original
2018-05-08 16:13:073286browse

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!

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