I have a list of dicts and one item of the dict is a date in m/d/Y format. I want to sort by that. I tried this:
sorted(data['trends'], key=lambda k: datetime.strptime(k['date_time'],'%m/%d/%Y')) But that fails with: Exception Type: AttributeError at /report/CDSEM/WaferAlignment/ajax/waChart.json Exception Value: 'module' object has no attribute 'strptime' How can I do this sort? -- https://mail.python.org/mailman/listinfo/python-list