title: Columns name for dictionary key and values using Pandas
body: <p>I am using pandas to dump some data into excel file. The data is in dictionary format and I am using the following code to dump it.</p>
  
  <pre><code>df1 = pd.DataFrame.from_dict(weights_dict, orient="index")
  df1.columns = ['weights']
  </code></pre>
  
  <p>I am getting the following output</p>
  
  <pre><code>             | weights
  ------------------------
  D1_sum       |  8
  U2_conv      |  9
  y1_maxpool   |  10
  y22_dropout  |  11
  </code></pre>
  
  <p>I want to set a name to the first column as well. How can I do that? Thanks.</p>
  
  <p>Expected output:</p>
  
  <pre><code>  Layers     | weights
  ------------------------
  D1_sum       |  8
  U2_conv      |  9
  y1_maxpool   |  10
  y22_dropout  |  11
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>After using </p>
  
  <pre><code>df.index.name = 'Layer'
  </code></pre>
  
  <p>I get the following result:</p>
  
  <pre><code>             | weights
  ------------------------
  Layer        |
  ------------------------
  D1_sum       |  8
  U2_conv      |  9
  y1_maxpool   |  10
  y22_dropout  |  11
  </code></pre>
  
  <p>Using the rename_axis gives following error:</p>
  
  <pre><code> File "C:\ENV\p34\lib\site-packages\pandas\core\generic.py", line 573, in rename
      result._data = result._data.rename_axis(f, axis=baxis, copy=copy)
    File "C:\ENV\p34\lib\site-packages\pandas\core\internals.py", line 2233, in rename_axis
      obj.set_axis(axis, _transform_index(self.axes[axis], mapper))
    File "C:\ENV\p34\lib\site-packages\pandas\core\internals.py", line 3982, in _transform_index
      items = [func(x) for x in index]
    File "C:\ENV\p34\lib\site-packages\pandas\core\internals.py", line 3982, in &lt;listcomp&gt;
      items = [func(x) for x in index]
  TypeError: 'str' object is not callable
  </code></pre>