title: How To Add Color to Specific Range of Table Columns in Matplotlib
body: <p>I'm attempting to add a colormap to a matplotlib table. I can do so, successfully, when all the data is intergers, but I currently have a column that's all text which is causing the program to fail(<code>TypeError: '&lt;' not supported between instances of 'int' and 'str' </code>). How would I skip the <code>STRINGS</code> column when applying my colormap?</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import matplotlib.pyplot as plt
  from matplotlib import colors
  from matplotlib.colors import ListedColormap
  
  # define figure and axes
  fig, ax = plt.subplots()
  
  # hide the axes
  fig.patch.set_visible(False)
  ax.axis('off')
  ax.axis('tight')
  
  # create data
  df = pd.DataFrame({
      'STRINGS': ['STRING1', 'STRING2', 'STRING3', 'STRINGS4', 'STRINGS5'],
      'Success Rate 1': [95, .02, -.03, 92, .05],
      'Success Rate 2': [-95, .06, .03, 92, .05]
  })
  
  #Colors
  red_green = ListedColormap(['red', '#70e000', '#38b000'])
  bounds = [-20, 0, 1, 100]
  norm = colors.BoundaryNorm(bounds, red_green.N)
  
  # create table
  matplotlib_table = plt.table(
      cellText=df.values,
      colLabels=df.columns,
      loc='center',
      cellColours=red_green(norm(df.values))
  )
  
  # display table
  fig.tight_layout()
  plt.show()
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/1OEXx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1OEXx.png" alt="enter image description here" /></a></p>