'How can I add a percentage difference column for each self/other pair in a pandas.dataframe.compare result?

It would be nice if the pandas compare function had a parameter that would include the percentage difference but that's not the case. Is there a relatively efficient way to do it? I have a lot of columns. Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source