I have writting a .csv dataset from some data being picked from the internet but within this new dataset I have a column with date of some clients were contacted and I would like to while I am writing this new dataset in .csv, I instruct python to sort ascending all cases according to date column, so that when I do Scatter Plot automatically the line chart follow the number of cases per day in ascending order of date. Please, note the missing values, they must come as they are with empty fields so that afterwards I can deal with them filling or removing. Thanks. My code is as follow:
with open('demo.csv', "w") as myfile:
print(mydata.decode('utf-8'),file=myfile)
date enrolled
6/29/2018 1
6/29/2018 1
6/29/2018
6/29/2018 1
6/20/2018 1
6/22/2018 1
6/19/2018 1
6/27/2018 1
6/28/2018
6/27/2018 1
6/19/2018 1
6/20/2018 1
6/27/2018 1
6/27/2018
6/26/2018 1
6/27/2018
6/27/2018 1