I am apply the following formatting to the pandas data frame.
The data is as follow:
{'In / Out': {'AAA': 'Out',
'BBB': 'In',
'Total1': 'Out',
'CCC': 'In',
'DDD': 'In',
'Total2': 'In'},
'Mln': {'AAA': '$-1,707',
'BBB': '$1,200',
'Total1': '$-507',
'CCC': '$245',
'DDD': '$1,353',
'Total2': '$1,598'},
'US$ Mln': {'AAA': '$-258',
'BBB': '$181',
'Total1': '$-77',
'CCC': '$32',
'DDD': '$175',
'Total2': '$206'}}
- First, I am trying to make the entire third and sixth row bold. And I already got an error.
- Second, I want the second, third and fourth column to be green when second column == In and red if second column == Out. How do I do this ?
- Third, I want the only the text 'Total1' and 'Total2' (not the entire column) to be right-aligned, the other text in the same column can remain left aligned.
Can someone show me how to code this up ?