numpy.char.join#
- char.join(sep, seq)[源代码]#
返回一个字符串,该字符串是序列 seq 中字符串的连接.
逐元素调用
str.join
.- 参数:
- sep : 类似数组,具有
StringDType
、bytes_
或str_
数据类型类似数组 - seq : 类似数组的对象,具有
StringDType
、bytes_
或str_
数据类型类似数组
- sep : 类似数组,具有
- 返回:
- outndarray
根据输入类型,输出
StringDType
、bytes_
或str_
类型的数组
参见
示例
>>> 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')