Numpy-char-add

提供:Dev Guides
2020年6月23日 (火) 03:12時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

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