def df_splitter(df, train_split=0.8):
    """
    Accepts a DataFrame and returns a train and test set.
    Default split is 80% train, 20% test.
    """

    df = df.copy()                      # Make shallow copy to not modify original
    df = df.sample(frac=1)              # Randomize copy
    split = int(len(df) * train_split)  # Find index cutoff using train split
    return df[:split], df[split:]       # Split and return randomized dataframe