title: How to remove illegal characters so a dataframe can write to Excel
body: <p>I am trying to write a dataframe to an Excel spreadsheet using ExcelWriter, but it keeps returning an error:</p>
  
  <pre><code>openpyxl.utils.exceptions.IllegalCharacterError
  </code></pre>
  
  <p>I'm guessing there's some character in the dataframe that ExcelWriter doesn't like. It seems odd, because the dataframe is formed from three Excel spreadsheets, so I can't see how there could be a character that Excel doesn't like!</p>
  
  <p>Is there any way to iterate through a dataframe and replace characters that ExcelWriter doesn't like? I don't even mind if it simply deletes them.</p>
  
  <p>What's the best way or removing or replacing illegal characters from a dataframe?</p>