title: TypeError: NAN/INF not supported in write_number() without 'nan_inf_to_errors' Workbook() option
body: <p>I want to save <strong>X</strong> (ndarray) with dimensions (3960, 225) in excel file (.xlsx). In <strong>X</strong> I have some missing values (<strong>nan</strong>). I made a code for it. However, I am getting the error.</p>
  <p>Here is the Code:</p>
  <pre><code>workbook = xlsxwriter.Workbook('arrays.xlsx')
      worksheet = workbook.add_worksheet()
      row = 0
      for col, data in enumerate(X):
          worksheet.write_column(row, col, data)
      workbook.close()
       df = pd.DataFrame(X)
  ## save to xlsx file
       filepath = 'my_excel_file.xlsx'
        df.to_excel(filepath, index=False)
  </code></pre>
  <p><strong>Here is the traceback:</strong></p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Program Files\JetBrains\PyCharm 2020.2.1\plugins\python\helpers\pydev\pydevd.py&quot;, line 1448, in _exec
      pydev_imports.execfile(file, globals, locals)  # execute the script
    File &quot;C:\Program Files\JetBrains\PyCharm 2020.2.1\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py&quot;, line 18, in execfile
      exec(compile(contents+&quot;\n&quot;, file, 'exec'), glob, loc)
    File &quot;C:/Users/Nafees Ahmed/PycharmProjects/Extra_Sensory_Experimetns/main.py&quot;, line 475, in &lt;module&gt;
      worksheet.write_column(row, col, data)
    File &quot;C:\Users\Nafees Ahmed\AppData\Local\Programs\Python\Python38\lib\site-packages\xlsxwriter\worksheet.py&quot;, line 69, in cell_wrapper
      return method(self, *args, **kwargs)
    File &quot;C:\Users\Nafees Ahmed\AppData\Local\Programs\Python\Python38\lib\site-packages\xlsxwriter\worksheet.py&quot;, line 1164, in write_column
      error = self._write(row, col, token, cell_format)
    File &quot;C:\Users\Nafees Ahmed\AppData\Local\Programs\Python\Python38\lib\site-packages\xlsxwriter\worksheet.py&quot;, line 481, in _write
      return self._write_number(row, col, *args)
    File &quot;C:\Users\Nafees Ahmed\AppData\Local\Programs\Python\Python38\lib\site-packages\xlsxwriter\worksheet.py&quot;, line 589, in _write_number
      raise TypeError(
  TypeError: NAN/INF not supported in write_number() without 'nan_inf_to_errors' Workbook() option
   
  </code></pre>
  <p>Perhaps, it is coming due to nan (missing) values. Is there any simple way to handle this error?</p>