Can I specify a pandas DataFrame index name in the constructor?
Said otherwise, I would like to do the following:
df = pd.DataFrame({"a":[1,2],"b":[3,4]})
df.rename_axis(index='myindex', inplace=True)
with a single line of code (by calling only the constructor)
df = pd.DataFrame({"a":[1,2],"b":[3,4]}).rename_axis(index='myindex')
. – Lytton