def drop_rows(df, head=False, tail=True, n=1):
    """
    Drop either the first n rows or the last n rows (or both) of a pandas DataFrame.
    Default is set to drop the last row.
    """
    if head:
        df = df.drop(df.head(n).index, inplace=True)
    if tail:
        df = df.drop(df.tail(n).index, inplace=True)
    return df