def df_to_csv(df,filename): 
    """
        writes dataframe to csv

        Parameters:
        df: pandas dataframe
        filename: csv name

    """ 
    data = df.to_csv(f'{filename}.csv',index=False)
    return data