How can I replace all the " " values with Zero's in a column of a pandas dataframe
<pre><code>titanic_df['Embarked'] = titanic_df['Embarked'].fillna("S")
</code></pre>

<p>titanic_df is data frame,Embarked is a column name. I have to missing cells in my column  i.e blank spaces and I want to add "S" at the missing place but the code I mentioned above is not working.Please help me.</p>

<p>Or you could use <code>apply</code></p>

<pre><code>titanic_df['Embarked'] = titanic_df['Embarked'].apply(lambda x: "S" if x == " " else x)
</code></pre>

python pandas