Return a string which is the concatenation of the strings in the sequence `seq`. Calls `str.join` element-wise. Parameters ---------- sep : array_like of str or unicode seq : array_like of str or unicode Returns ------- out : ndarray Output array o
(sep, seq)
| 1026 | |
| 1027 | @array_function_dispatch(_join_dispatcher) |
| 1028 | def join(sep, seq): |
| 1029 | """ |
| 1030 | Return a string which is the concatenation of the strings in the |
| 1031 | sequence `seq`. |
| 1032 | |
| 1033 | Calls `str.join` element-wise. |
| 1034 | |
| 1035 | Parameters |
| 1036 | ---------- |
| 1037 | sep : array_like of str or unicode |
| 1038 | seq : array_like of str or unicode |
| 1039 | |
| 1040 | Returns |
| 1041 | ------- |
| 1042 | out : ndarray |
| 1043 | Output array of str or unicode, depending on input types |
| 1044 | |
| 1045 | See Also |
| 1046 | -------- |
| 1047 | str.join |
| 1048 | |
| 1049 | Examples |
| 1050 | -------- |
| 1051 | >>> np.char.join('-', 'osd') |
| 1052 | array('o-s-d', dtype='<U5') |
| 1053 | |
| 1054 | >>> np.char.join(['-', '.'], ['ghc', 'osd']) |
| 1055 | array(['g-h-c', 'o.s.d'], dtype='<U5') |
| 1056 | |
| 1057 | """ |
| 1058 | return _to_bytes_or_str_array( |
| 1059 | _vec_string(sep, object_, 'join', (seq,)), seq) |
| 1060 | |
| 1061 | |
| 1062 |