Set index name of pandas DataFrame
<p>I have a pandas dataframe like this: </p>

<pre><code>    ''     count
sugar      420
milk       108
vanilla    450
...
</code></pre>

<p>The first column has no header and I would like to give it the name: 'ingredient'. </p>

<p>I created the dataframe from a csv file: </p>

<pre><code>df = pd.read_csv('./data/file_name.csv', index_col=False, encoding="ISO-8859-1")  
df = df['ingredient_group']  #selecting column 
df = df.value_counts()       #calculating string occurance which return series obj
df = pd.DataFrame(df)        #creating dataframe from series obj
</code></pre>

<p>How do I assign the name 'ingredient' to the first column which has currently no name? </p>

<p>I already tried: </p>

<pre><code>df_count.rename(columns={'': 'ingredient'}, inplace=True)

df = pd.DataFrame(df, columns = ['ingredient','count']
</code></pre>

<p>How do I prevent this from happening? </p>

<pre><code>''        count
ingredient  ''
sugar      420
milk       108
vanilla    450
...
</code></pre>