python select function from list. This function takes the original array