title: pandas :Read xlsx file to dict with column1 as key and column2 as values
body: <p>I am new to pandas. I need to read a <code>xlsx</code> file and convert first column to key of a dict and second column to values of a dict using <code>pandas</code>. I also need to skip / exclude first row which are headers.</p>
  
  <p>The answer <a href="https://stackoverflow.com/questions/26531142/how-to-get-a-dictionary-of-data-in-column1-as-key-and-column2-as-the-value">here</a> is for <code>pymysql</code> and <a href="https://stackoverflow.com/questions/17870022/read-two-column-csv-as-dict-with-1st-column-as-key">here</a> is for <code>csv</code>. I need to user <code>pandas</code>.</p>
  
  <p>Here is a sample excel data</p>
  
  <pre><code>dict_key    dict_value  
  key1        str_value1  
  key2        str_value2  
  key3         None  
  key4         int_value3  
  </code></pre>
  
  <p>My code so far is as below. </p>
  
  <pre><code>import pandas as pd
  
  excel_file = "file.xlsx"
  xls = pd.ExcelFile(excel_file)
  df = xls.parse(xls.sheet_names[0], skiprows=1, index_col=None, na_values=['None'])
  data_dict = df.to_dict()
  </code></pre>
  
  <p>However, it gives me dict where keys are column numbers and values are both column1 data as well as column2 data.</p>
  
  <pre><code>&gt;&gt;&gt; data_dict
  {u'Chg_Parms': {0: u'  key1 ', 1: u'   key2 ', 2: u'   key3 ', 3: u'   key4 ', 4: u'   str_value1 ', 
                  5: u'   str_value2 ', 6: u'   Nan ', 6: u'   int_value3 '}}
  </code></pre>
  
  <p>what I would like to have is column1 data as key and column two data as values and also <code>NaN</code> replaced with <code>None</code></p>
  
  <pre><code>data_dict = {'key1': 'str_value1', 'key2': 'str_value2', 'key3': None, 'key4': int_value3}
  </code></pre>
  
  <p>Thanks for your help.</p>