title: Limit decimals numbers when writing to csv in python
body: <p>I loop over files and for each of these files, I compute a list of 4000+ (fixed number) features on it. These features are computed by a function and returned as <code>numpy.array</code></p>
  
  <p>I want to write a CSV file with one line per file (each line is one <code>numpy.array</code>with 4000+ elements).</p>
  
  <p>I'm currently using the <code>csv</code>library of Python and even if my array is rounded (thanks to <code>np.around</code>), the CSV file contains numbers with a lot of digits, e.g. <code>0,302499999999999</code>instead of <code>0,3025</code></p>
  
  <p>I know this may come from <a href="https://docs.python.org/3/tutorial/floatingpoint.html" rel="nofollow">floating points limitations</a> in Python, but i wanted to know if there is any way to avoid this (by writing it as a string?) in the output file.</p>
  
  <p>Sample of code below to reproduce the issue :</p>
  
  <pre><code>import numpy as np
  import csv
  
  for i in range(10) :
      row = np.around(np.random.random(4000), decimals=5)
  
      with open('output.csv', "ab") as fp:
          wr = csv.writer(fp, dialect='excel')
          wr.writerow(row)
  </code></pre>