Jun-12-2018, 09:25 AM
Maybe this is less
numpy
-way, but it worked for meimport itertools from operator import itemgetter np.array([np.array(list(grp)).max(0) for _, grp in itertools.groupby(sys_func, key=itemgetter(0))])
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.