title: Elegant way to create empty pandas DataFrame with NaN of type float
body: <p>I want to create a Pandas DataFrame filled with NaNs. During my research I found <a href="https://stackoverflow.com/questions/13784192/creating-an-empty-pandas-dataframe-then-filling-it">an answer</a>:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(index=range(0,4),columns=['A'])
  </code></pre>
  
  <p>This code results in a DataFrame filled with NaNs of type "object". So they cannot be used later on for example with the <code>interpolate()</code> method. Therefore, I created the DataFrame with this complicated code (inspired by <a href="https://stackoverflow.com/questions/1704823/initializing-numpy-matrix-to-something-other-than-zero-or-one">this answer</a>):</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  dummyarray = np.empty((4,1))
  dummyarray[:] = np.nan
  
  df = pd.DataFrame(dummyarray)
  </code></pre>
  
  <p>This results in a DataFrame filled with NaN of type "float", so it can be used later on with <code>interpolate()</code>. Is there a more elegant way to create the same result?</p>