Skip to content

Commit f7bf5ab

Browse files
committed
PERF: Add if branch for empty sep in str.cat
1 parent 9a42cbe commit f7bf5ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/strings.py

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def cat_core(list_of_columns, sep):
4848
nd.array
4949
The concatenation of list_of_columns with sep
5050
"""
51+
if sep == '':
52+
return np.sum(list_of_columns, axis=0)
5153
list_with_sep = [sep] * (2 * len(list_of_columns) - 1)
5254
list_with_sep[::2] = list_of_columns
5355
return np.sum(list_with_sep, axis=0)

0 commit comments

Comments
 (0)