def homogenize(series_dict):
index = None<EOL>need_reindex = False<EOL>for _, series in series_dict.items():<EOL><INDENT>if not np.isnan(series.fill_value):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if index is None:<EOL><INDENT>index = series.sp_index<EOL><DEDENT>elif not series.sp_index.equals(index):<EOL><INDENT>need_reindex = True<EOL>index = index.intersect(series.sp_index)<EOL><DEDENT><DEDENT>if need_reindex:<EOL><INDENT>output = {}<EOL>for name, series in series_dict.items():<EOL><INDENT>if not series.sp_index.equals(index):<EOL><INDENT>series = series.sparse_reindex(index)<EOL><DEDENT>output[name] = series<EOL><DEDENT><DEDENT>else:<EOL><INDENT>output = series_dict<EOL><DEDENT>return output<EOL>
Conform a set of SparseSeries (with NaN fill_value) to a common SparseIndex
corresponding to the locations where they all have data

Parameters
----------
series_dict : dict or DataFrame

Notes
-----
Using the dumbest algorithm I could think of. Should put some more thought
into this

Returns
-------
homogenized : dict of SparseSeries