def reindex(series1, series2):

    # turns out the merge is much faster than the .loc below
    df = pd.merge(pd.DataFrame({"left": series2}),
                  pd.DataFrame({"right": series1}),
                  left_on="left",
                  right_index=True,
                  how="left")
    return df.right

    # return pd.Series(series1.loc[series2.values].values, index=series2.index)
This reindexes the first series by the second series.  This is an extremely
dataset/ETHPy150Open UDST/urbansim/urbansim/utils/misc.py/reindex