Thu Aug 25 2016
Copied to clipboard! Copy reply
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
import operator

information = [["John","1","2","6"], ["Martin","1","1","5"] ]
#information = [["John","1","2","6"],  ["Martin","0","1","5"]]
#information = [["John","1","1","6"], ["Martin","1","2","6"]]
#information = [["John","1","10","10"]]
information = [["John","1","1","2"], ["Luke","1","2","1"]]
#information = [["John","1","2","2"], ["Luke","1","1","2"]]
information = [["John","1","2","6"], ["Martin","0","1","5"]]

# take out people on vacation
information = list(filter(lambda x: x[1] != "0", information))


array = sorted(map(lambda item: [item[0],  int(item[2]), int(item[3])], list(filter(lambda x: x[1] != "0", information))), key=operator.itemgetter(2, 1))
print array