File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 18
18
import pandas .core .common as com
19
19
from pandas .core .algorithms import take_1d
20
20
import pandas .compat as compat
21
+ from pandas .compat .numpy import _np_version_under1p11
21
22
from pandas .core .base import NoNewAttributesMixin
22
23
from pandas .util ._decorators import Appender
23
24
import re
@@ -57,9 +58,12 @@ def cat_core(all_cols, sep):
57
58
list_of_columns = np .split (all_cols , all_cols .shape [1 ], axis = 1 )
58
59
list_with_sep = [sep ] * (2 * len (list_of_columns ) - 1 )
59
60
list_with_sep [::2 ] = list_of_columns
60
- # np.split splits into arrays of shape (N, 1); NOT (N,)
61
- # need to reduce dimensionality of result
62
- return np .sum (list_with_sep , axis = 0 )[:, 0 ]
61
+ res = np .sum (list_with_sep , axis = 0 )
62
+ if not (_np_version_under1p11 and len (res ) == 0 ):
63
+ # np.split splits into arrays of shape (N, 1); NOT (N,)
64
+ # need to reduce dimensionality of result
65
+ res = res [:, 0 ]
66
+ return res
63
67
64
68
65
69
def _na_map (f , arr , na_result = np .nan , dtype = object ):
You can’t perform that action at this time.
0 commit comments