title: python 3.6 json.dumps ValueError using allow_nan=True
body: <p>I am currently working on moving from python 2.7 to python 3.6</p>
  
  <p>Python 2.7 code that works</p>
  
  <pre><code>json.dump(data, ignore_nan=True)
  </code></pre>
  
  <p>Python 3.6 code</p>
  
  <pre><code>json.dumps(charts, allow_nan=False)
  </code></pre>
  
  <p>Error Message:</p>
  
  <pre><code>{ValueError}Out of range float values are not JSON complaint
  </code></pre>
  
  <p><strong>How should I dump the information ignoring nan values?</strong> </p>
  
  <p>Example:</p>
  
  <pre><code> "series": [
                  {
                      "data": [
                          {
                              "value": 60.6,
                              "x": 1538431200000.0
                          },
                          {
                              "value": 80.6,
                              "x": 1538434800000.0
                          },
  </code></pre>