yes i am doing some complicated (read: convoluted) data manipulation at work because of unclean data…!!
in any case, great to learn this! combining groupby and apply to use a custom function when aggregating the dataframe.
https://medium.com/@sean.turner026/applying-custom-functions-to-groupby-objects-in-pandas-61af58955569
also late to the game but finally getting into test coverage!
for folks using pytest, check out https://pypi.org/project/pytest-cov/