Python Array Get Function Matlab Syntax For Logical If Statement