title: python dataframe to_dict by index, exclude NaN
body: <p>samp dataframe</p>
  
  <pre><code>     v1 v2  v3  v4  v5  v6
  index                                                                   
  0   -2  -2  -2  NaN -2  -2
  1   -2  -2  -2  NaN -2  -2
  2   -2  -2  -2  NaN -2  -2
  3   -2  -2  -2  -2  -2  -2
  4   -2  -2  -2  NaN -2  -2
  </code></pre>
  
  <p>Am trying to change dataframe to dictionary
  and i want to ignore 'nan' field in json documents</p>
  
  <p>What am trying:</p>
  
  <pre><code>import pandas as pd
  pd.DataFrame((samp.to_dict('index')).items())
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>index    values
  0   {'v1':'-2', 'v2':'-2','v3':'-2','v5':'-2','v6':'-2'}
  1   {'v1':'-2', 'v2':'-2','v3':'-2','v5':'-2','v6':'-2'}
  2   {'v1':'-2', 'v2':'-2','v3':'-2','v5':'-2','v6':'-2'}
  3   {'v1':'-2', 'v2':'-2','v3':'-2','v4':'-2','v5':'-2','v6':'-2'}
  4   {'v1':'-2', 'v2':'-2','v3':'-2','v5':'-2','v6':'-2'}
  </code></pre>