def arr2series(array, series_index=[], series_name='predictions'):
    """Accepts an array, an index, and a name. If series_index is longer than array:
    the series_index[-len(array):] """
    import pandas as pd
    if len(series_index) == 0:
        series_index = list(range(len(array)))
    if len(series_index) > len(array):
        new_index = series_index[-len(array):]
        series_index = new_index
    preds_series = pd.Series(array.ravel(), index=series_index, name=
        series_name)
    return preds_series
