Table Of Contents


Enter search terms or a module, class or function name., sep=None, na_rep=None)[source]

Concatenate strings in the Series/Index with given separator.


others : list-like, or list of list-likes

If None, returns str concatenating strings of the Series

sep : string or None, default None

na_rep : string or None, default None

If None, NA in the series are ignored.


concat : Series/Index of objects or str


When na_rep is None (default behavior), NaN value(s) in the Series are ignored.

>>> Series(['a','b',np.nan,'c'])' ')
'a b c'
>>> Series(['a','b',np.nan,'c'])' ', na_rep='?')
'a b ? c'

If others is specified, corresponding values are concatenated with the separator. Result will be a Series of strings.

>>> Series(['a', 'b', 'c'])['A', 'B', 'C'], sep=',')
0    a,A
1    b,B
2    c,C
dtype: object

Otherwise, strings in the Series are concatenated. Result will be a string.

>>> Series(['a', 'b', 'c'])',')

Also, you can pass a list of list-likes.

>>> Series(['a', 'b'])[['x', 'y'], ['1', '2']], sep=',')
0    a,x,1
1    b,y,2
dtype: object
Scroll To Top