title: How to use DataFrame.rename to rename a dataframe index (not inplace)
body: <p>I'm highly confused by the <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rename.html#pandas.DataFrame.rename" rel="nofollow noreferrer">DataFrame.rename docs</a>.</p>
  
  <p>They suggest I should be able to rename indexes the same way as columns.
  It ain't so:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame([1], columns=["A"])
  df.index.name = 'i'
  
  print df
  print df.rename(columns={"A":"B"})  # Success! A is renamed B
  print df.rename(index={"i":"j"})    # No-op
  print df.rename({"i":"j"}, axis=0)    # No-op
  print df.rename({"i":"j"}, axis=1)    # No-op
  
  print df.rename(index={"i":"j"}, axis=1) #  Cannot specify both 'axis' and any of 'index' or 'columns'.
  print df.rename(index={"i":"j"}, axis="index")  #  Cannot specify both 'axis' and any of 'index' or 'columns'.
  print df.rename(index={"i":"j"}, axis="columns") #  Cannot specify both 'axis' and any of 'index' or 'columns'.
  print df.rename(index={"i":"j"}, axis=0) #  Cannot specify both 'axis' and any of 'index' or 'columns'.
  </code></pre>