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.
also late to the game but finally getting into test coverage!
for folks using pytest, check out https://pypi.org/project/pytest-cov/