I am using group by apply and in the function in apply i am creating a csv. However, since i read somewhere that groupby is evaluated many times i am getting multiple csvs for the same data. How do i stop this from happening?
alerts = evening_data.groupby([identification, name, age,
address]).apply(master, args='F').reset_index(drop=True)
def master(data, f):
data.to_csv('test.csv')
I sometimes get two test.csv files. othertimes not.