Rearranges the columns in a dataframe based on if all of its rows are empty. Columns that are non-empty are placed at the front of the dataframe, and columns that are empty are placed at the back.

sort_empty_cols(df)

Arguments

df

A dataframe that contains columns that need to be rearranged

Value

A dataframe where the columns are rearranged