Python Array

来源:互联网 发布:centos macaddr 不写 编辑:程序博客网 时间:2024/06/05 15:27

append: Appends object at end.

x = [1, 2, 3]x.append([4, 5])print (x)

gives you: [1, 2, 3, [4, 5]]

extend: Extends list by appending elements from the iterable.

x = [1, 2, 3]x.extend([4, 5])print (x)

Concatenate

import numpya = numpy.array([1, 2, 3])b = numpy.array([5, 6])numpy.concatenate([a,b])
0 0
原创粉丝点击