title: Inserting NaN value into MySQL Database
body: <p>I have some data that contains NULLs, floats and the occasional Nan. I'm trying to insert this data into a MySQL database using python and MySqldb. </p>
  
  <p>Here's the insert statement:</p>
  
  <pre><code>for row in zip(currents, voltages):
          row = [id] + list(row)
          for item in row:
              sql_insert = ('INSERT INTO result(id, current, voltage)'
                              'VALUES(%s, "%s")')
              cursor.execute(sql_insert, row)
  </code></pre>
  
  <p>This is the table:</p>
  
  <pre><code>CREATE TABLE langmuir_result (result_id INT auto_increment, 
                                id INT, 
                                current FLOAT,
                                voltage FLOAT,
                                PRIMARY KEY (result_id));
  </code></pre>
  
  <p>When I try to insert NaN into the table I get this error:</p>
  
  <pre><code>_mysql_exceptions.DataError: (1265, "Data truncated for column 'current' at row 1")
  </code></pre>
  
  <p>I want to insert the NaN values into the database as a float or a number, not a string or NULL. I've tried having the type of the column be FLOAT and DECIMAL but get the same error. How can I do this without making it a string or NULL? Is that possible?</p>