Skip to content

Commit 2e0d03a

Browse files
committed
PERF: Add if branch for empty sep in str.cat
1 parent 0fd888c commit 2e0d03a

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
@@ -59,6 +59,8 @@ def cat_core(list_of_columns: List, sep: str):
5959
nd.array
6060
The concatenation of list_of_columns with sep
6161
"""
62+
if sep == '':
63+
return np.sum(list_of_columns, axis=0)
6264
list_with_sep = [sep] * (2 * len(list_of_columns) - 1)
6365
list_with_sep[::2] = list_of_columns
6466
return np.sum(list_with_sep, axis=0)

0 commit comments

Comments
 (0)