def sort_dataframe(dataframe, sort_column, order='ascending', nulls_position='last', inplace=True):
    """
    Sort the dataframe by the sort column
    Arguments are the dataframe and column that you want to sort by
    Optional arguments are:
    - order (default ascending, can be ascending or descending) which determines
    whether to sort by the column ascending or descending
    - nulls_position (default last, can be first or last) which determines
    whether null values (NaN) are sorted first or last
    - inplace (default True, can be True or False) which determines whether
    to change the existing dataframe, or return a new dataframe
    """
    if order == 'ascending':
        ascending = True
    else:
        ascending = False
    df = dataframe.sort_values(sort_column, ascending=ascending, na_position=nulls_position, inplace=inplace)
    if not inplace:
        return df