Jun-12-2018, 10:00 AM
(Jun-12-2018, 09:32 AM)Mekire Wrote: Hmm, I was looking for something like that and didn't find what I need.
I'm surprised there isn't a sort offindgroups
innumpy
itself (and there may well be), but I didn't have any luck finding it.
There's
pandas.DataFrame.groupby
- so that will work tooimport pandas as pd df = pd.DataFrame(sys_func) np.array([g.max() for _, g in df.groupby(df[0])])Closer to home - but still not pure-
numpy
solution
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.