I would like to ask if it is possible to combine different style formatting in pandas. For instance I want to combine the following 4 styles at once.
df.style.format({'vm_unity': '{:.2%}'}).bar(subset=['vm_unity'], align='mid', color=['#d65f5f', '#5fba7d'])
df.style.bar(subset=['vm_top'], align='mid', color=['#d65f5f', '#5fba7d'])
df.style.bar(subset=['vm_bot'], align='mid', color=['#d65f5f', '#5fba7d'])
df.style.bar(subset=['Sy'], align='mid', color=['#d65f5f', '#5fba7d'])
The way that I currently perform it is to combine them in a single line but I believe that it's not the most elegant way of doing it
df.style.format({'vm_unity': '{:.2%}'}).bar(subset=['vm_unity'], align='mid', color=['#d65f5f', '#5fba7d']).bar(subset=['vm_top'], align='mid', color=['#d65f5f', '#5fba7d']).bar(subset=['vm_bot'], align='mid', color=['#d65f5f', '#5fba7d']).bar(subset=['Sy'], align='mid', color=['#d65f5f', '#5fba7d'])
Can you please drop a line for a more effective way?