I want to make a smaller size list around a maximum value of a big list. How can I do that efficiently using python.
tmp=[11, 22, 13, 45 ,21, 56, 26, 9, 10, 89, 77, 34, 91, 65, 67]
max_val=max(tmp)
max_index=tmp.index(max_val)
print max_index,i,max_val
In this list, the index and the maximum value and those are 13 and 91. I want a list around the index 13 of width 2 i,e [77, 34, 91, 65, 67]
Best Sudipta