numpy.char.join#
- char.join(sep, seq)[source]#
返回一個字串,該字串是序列 seq 中字串的串聯。
逐元素呼叫
str.join
。- 參數:
- separray-like,具有
StringDType
、bytes_
或str_
dtype - seqarray-like,具有
StringDType
、bytes_
或str_
dtype
- separray-like,具有
- 返回:
- outndarray
輸出
StringDType
、bytes_
或str_
dtype 的陣列,取決於輸入類型
參見
範例
>>> import numpy as np >>> np.strings.join('-', 'osd') array('o-s-d', dtype='<U5')
>>> np.strings.join(['-', '.'], ['ghc', 'osd']) array(['g-h-c', 'o.s.d'], dtype='<U5')