title: Why is the python "dtype=float" 8-byte rather than 4-byte?
body: <p>These days, I've switched from Matlab to NumPy/SciPy.</p>
  
  <p>Today, I encountered a weird problem when I tried to load data stored in "binary format". Audio data is stored in the <strong>4-byte single-precision floating point number</strong>  format. I tried the following first.</p>
  
  <pre><code>data = np.fromfile('out.raw', dtype=float) # This is wrong
  plt.plot(data)
  </code></pre>
  
  <p>But it didn't work. After some search, I tried the following, and it worked as expected:</p>
  
  <pre><code>data = np.fromfile('out.raw', dtype=np.float32) # This is okay.
  plt.plot(data)
  </code></pre>
  
  <p>Based on my previous experience with C/C++, I had expected "float" to be a 4-byte single-precision floating point type. But it turns out that the float is 8-byte data, and in the above case, I should have used np.float32. </p>
  
  <p>I have two questions regarding this.</p>
  
  <p><strong>Q1</strong>. <strong>Why is the float 8-byte rather than 4-byte, which might be confusing to C/C++ programmers?</strong></p>
  
  <p><strong>Q2</strong>. <strong>Why can't I use dtype=float32. This causes an error to me. I seems like I should use dtype=np.float32?</strong></p>
  
  <p>Thank you!</p>