So I have a csv file that I entered using the following code:
csvdata = np.loadtxt(sys.argv[2],
delimiter=',',
dtype={
'names': ('year', 'month', 'day', 'ItemName'),
'formats': ('i4', 'i4', 'i4', 'S10')
}
)
Now, I wanted to sort this data based on year, month and day. Can someone tell me how to do this????
Csv Data looks like this:
2012,3,6,ABCD
2012,3,6,XYZA
The thing is, it is currently getting sorted on the name. I wanted it on the date.
csvdata?numpy.sort