简体   繁体   English

Python numpy数组串联

[英]Python numpy array concatenation

I have a doubt in numpy array concatenation. 我对numpy数组串联有疑问。

For eg, 例如

If I have 如果我有

a = [ 1, 2, 3]
b = [4, 5, 6, 7]
c= [5, 2]

Could I concatenate arrays of different size??? 我可以串联不同大小的数组吗??? If so, How could it be possible? 如果是这样,怎么可能?

Yes, You can using numpy.concatenate 是的,您可以使用numpy.concatenate

import numpy as np
a = [ 1, 2, 3]
b = [4, 5, 6, 7]
c= [5, 2]
d = np.concatenate((a, b, c))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM