title: Removing Carriage Returns from Csv String
body: <p>I am generating a csv string using pandas as such:
  <code>df.to_csv(sep=',', encoding='utf-8', index=False, header=False)</code>.</p>
  
  <p>I will load the csv in postgres as follows.</p>
  
  <pre><code>    COPY table_name FROM STDIN (FORMAT CSV,
      DELIMITER ',',
      HEADER FALSE,
      NULL '',
      ENCODING 'utf-8');
  </code></pre>
  
  <p>Occasionally this will fail when there is carriage return present in the csv, which I remove using <code>csv_str.replace('\r', '')</code>. However I am not sure if this approach might alter some existing data in the csv by any chance.</p>
  
  <p>Is there a more reliable way to remove any carriage returns? I am fine with losing information about the carriage returns, but I want to preserve as much as possible any other data stored in the csv files.</p>