def _get_series_result_type(result):
 if isinstance(result, dict):
  if all((is_sparse(c) for c in compat.itervalues(result))):
   from pandas.sparse.api import SparseDataFrame
   return SparseDataFrame
  else:
   from pandas.core.frame import DataFrame
   return DataFrame
 elif is_sparse(result):
  from pandas.sparse.api import SparseSeries
  return SparseSeries
 else:
  from pandas.core.series import Series
  return Series

def _get_series_result_type ( result ) : if isinstance ( result , dict ) : if all ( ( is_sparse ( c ) for c in compat . itervalues ( result ) ) ) : from pandas . sparse . api import SparseDataFrame return SparseDataFrame else : from pandas . core . frame import DataFrame return DataFrame elif is_sparse ( result ) : from pandas . sparse . api import SparseSeries return SparseSeries else : from pandas . core . series import Series return Series
return appropriate class of series concat input is either dict or array-like .