Numpy-char-add

提供:Dev Guides
移動先:案内検索

numpy.char.add()

この関数は、要素ごとの文字列連結を実行します。

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']