I know that it is not allowed to remove elements while iterating a list, but is it allowed to add elements to a python list while iterating. Here is an example:
Alternate solution :
reduce(lambda x,newObj : x +[newObj] if somecond else x,myarr,myarr)