title: pandas style options to latex
body: <p>Pandas has two nice functionalities I use a lot - that's the <code>df.style...</code> option and the <code>df.to_latex()</code> call. But I do not know how to combine both.</p>
  
  <p>The .style option makes looking at tables much more pleasant.  It lets you grasp information rapidly because of visual enhancements. This works perfectly in a jupyter notebook, for example. Here is an arbitrary example I copied from the <a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html" rel="noreferrer">documentation</a>.</p>
  
  <pre><code>df.style.bar(subset=['A', 'B'], align='mid', color=['#d65f5f', '#5fba7d'])
  </code></pre>
  
  <p>This yields:</p>
  
  <p><a href="https://i.stack.imgur.com/VR69Q.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VR69Q.png" alt="Dataframe with style columns"></a></p>
  
  <p>However, as nice as this looks in a jupyter notebook, I can not put this to latex code. I get the following error message instead, if chaining a 'to_latex()' call at the end of my visual enhancements: <code>AttributeError: 'Styler' object has no attribute</code>. Does that mean it's simply not possible, because the displayed colorful table is not a DataFrame object any more, but now a Styler object, now? </p>
  
  <p>Is there any workaround? At least with easier tables, let's say where only cells have a single background color with respect to their value, instead of a 'complicated' bar graph.</p>