title: Combining pandas "data frame.style" objects and outputting to html
body: <p>I would like to combine pandas <code>df.style</code> objects that use the following methods - <code>df.style.background_gradient</code> and <code>df.style.bar</code> and export the result to html.</p>
  
  <p>I'm successful when I have separate objects. Here is an example data frame:</p>
  
  <pre><code>df = pd.DataFrame(np.random.randn(15).reshape(5, 3))
  </code></pre>
  
  <p>I can then pass this to the different style methods:</p>
  
  <pre><code># Use method "background_gradient"
  styled_df_a = df.style.background_gradient(subset=[0, 1], 
                                         low=0, high=0.5, 
                                         cmap="YlGnBu")
  
  # Use method "bar"
  styled_df_b = df.style.bar(subset=[2], align='mid', 
                         color=['#d65f5f', '#5fba7d'])
  </code></pre>
  
  <p>I subsequently export each of the styled tables to html:</p>
  
  <pre><code># Export styled table a to html
  html = styled_df_a.render()
  with open("df_a.html","w") as fp:
  fp.write(html)
  
  # Export styled table b to html
  html = styled_df_b.render()
  with open("df_b.html","w") as fp:
  fp.write(html)  
  </code></pre>
  
  <p>I therefore have 2 html rendered styled tables. However, I would like to combine the 2 methods into 1 html styled table, such that columns 1-2 have the <code>background_gradient</code> styling and column 3 has the <code>bar</code> styling.</p>
  
  <p>I tried this:</p>
  
  <pre><code>styled_df_c = styled_df_a.style.bar(subset=[2], align='mid', 
                                  color=['#d65f5f', '#5fba7d'])
  </code></pre>
  
  <p>This doesn't work due to the following error:</p>
  
  <pre><code>AttributeError: 'Styler' object has no attribute 'style'
  </code></pre>
  
  <p>Is there a way to do this through some other means? I did try experimenting with the <code>style.apply</code> method of pandas but got a similar error as above.</p>