此函数执行逐元素的字符串连接。
import numpy as np print 'Concatenate two strings:' print np.char.add(['hello'],[' xyz']) print '\n' print 'Concatenation example:' print np.char.add(['hello', 'hi'],[' abc', ' xyz'])
其输出如下-
Concatenate two strings: ['hello xyz'] Concatenation example: ['hello abc' 'hi xyz']
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
PPT设计进阶 · 从基础操作到高级创意 -〔李金宝(Bobbie)〕