in python 2.7 this section is fine. It opens and reads a csv file, sorts and then writes to a final file.
data = csv.reader(open('H:\\python code\\hpsm_file1.csv'),delimiter=',')
sortedlist = sorted(data, key=operator.itemgetter(3))
in python 3.7 it fails with this error. There are no other changes other than the version of python has changed
IndexError: list index out of range