stack() is an excellent Pandas function. It return Stacked dataframe or series. How to parse this output and print it well-formatted (like using to_mar
stack()
Stacked dataframe or series