title: Formatting pandas dataframes displayed in jupyter notebooks with comma separated values AND red font for negative values
body: <p>Executing my script in jupyter notebooks, which returns 4 pandas dataframes as the result. The output tables contain large numbers and visually it is messy to interpret without some formatting. I want to colour negative values in red font and all numbers separated by 1,000 comma delimiters.</p>
  
  <p>If I set the pandas option to display float formats</p>
  
  <p>(<code>pd.options.display.float_format = '{:20,.0f}'.format</code>)</p>
  
  <p>I get the comma separated result.</p>
  
  <p>However, if I use CSS styling to to colour negative values red, it seems to overide the float format settings and I lose the comma separators. (<a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html" rel="nofollow noreferrer">https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html</a>)</p>
  
  <p>Example script:</p>
  
  <pre><code>from IPython.core.interactiveshell import InteractiveShell
  InteractiveShell.ast_node_interactivity = "all"
  
  import pandas as pd
  
  pd.options.display.float_format = '{:20,.0f}'.format
  
  def color_negative_red(val):
      color = 'red' if val &lt; 0 else 'black'
      return 'color: %s' % color
  
  
  a = [-1000, -15000, 120000, 3000]
  b = [5000, 6000000, -350000, 45000]
  
  
  df = pd.DataFrame({'A':a, 'B':b})
  
  df1 = df.style.format('{:,.0f}')
  df2 = df.style.applymap(color_negative_red)
  
  df1
  df2
  </code></pre>
  
  <p>I can return these independently, but I can't perform both formatting events to the same dataframe. There must be a simpler solution ?</p>