def clean(df):
    """
    Takes a dataframe,
    checks if dead, changes dead to NaNs,
    returns dataframe without full rows of NaNs
    """
    for sample in df:
        last_row = int(df.loc[df[sample] >= df[sample].max()-1].iloc[0].name)
        df.loc[df.index > last_row, [sample]] = None

    df = df.dropna(how='all')
    return df