title: Multi-condition formatting on Pandas DF
body: <p>I've got a dataframe looks like this:</p>
  
  <pre><code>    x   y   z
  0   1   0   10
  1   1   10  400
  2   1   10  95
  </code></pre>
  
  <p>To reproduce the data frame, use the following code.  </p>
  
  <pre><code>import pandas as pd
  df = {'x': [1,1,10], 'y': [0,10,10], 'z': [10,400,95]}
  df = pd.DataFrame(df, columns = ['x', 'y', 'z'])
  </code></pre>
  
  <p>Blanks are filled with 0, hence all cells have a value present.</p>
  
  <p>I want to run/apply a set of conditions on this DF such that:</p>
  
  <ol>
  <li>If column Y has a value == 0, then replace the value with 'red: 0'</li>
  <li>If column Z has a value > 300, then replace the value with 'red: {value}'</li>
  <li>If column Z has a value > 90, then replace the value with 'yellow: {value}'</li>
  </ol>
  
  <p>Basically I'm trying to convert a DF into a wiki table with some conditional color formatting applied. After the formatting it should look like:</p>
  
  <pre><code>|=x|=y|=z
  |1|'red: 0'|10
  |1|10|'red: 400'
  |1|10|'yellow: 95'
  </code></pre>
  
  <p>Is there a clean way of doing this?</p>
  
  <p>PS: There are two original datasources, list of dictionary and a nested dictionary which was converted into a DF. Any idea if it's easier to do outside of Pandas?</p>