def _concat_categorical(to_concat, axis=0):
 def _concat_asobject(to_concat):
  to_concat = [(x.get_values() if is_categorical_dtype(x.dtype) else x.ravel()) for x in to_concat]
  res = _concat_compat(to_concat)
  if (axis == 1):
   return res.reshape(1, len(res))
  else:
   return res
 categoricals = [x for x in to_concat if is_categorical_dtype(x.dtype)]
 if (len(categoricals) != len(to_concat)):
  pass
 else:
  first = to_concat[0]
  if all((first.is_dtype_equal(other) for other in to_concat[1:])):
   return union_categoricals(categoricals)
 return _concat_asobject(to_concat)

def _concat_categorical ( to_concat , axis = 0 ) : def _concat_asobject ( to_concat ) : to_concat = [ ( x . get_values ( ) if is_categorical_dtype ( x . dtype ) else x . ravel ( ) ) for x in to_concat ] res = _concat_compat ( to_concat ) if ( axis == 1 ) : return res . reshape ( 1 , len ( res ) ) else : return res categoricals = [ x for x in to_concat if is_categorical_dtype ( x . dtype ) ] if ( len ( categoricals ) != len ( to_concat ) ) : pass else : first = to_concat [ 0 ] if all ( ( first . is_dtype_equal ( other ) for other in to_concat [ 1 : ] ) ) : return union_categoricals ( categoricals ) return _concat_asobject ( to_concat )
concatenate an object/categorical array of arrays .