In dataframe iam getting unexpected results
<p>when i have tried with below code iam getting unexpected results.<br>
This is my code:
    def copy_blanks(df, column):</p>

<pre><code>    df.iloc[:, -1] = df.iloc[:, column]
    df.loc[df.iloc[:, column] == '', -1] = ''

My input file:
word,number
abc,0
adf,0
gfsgs,0
,0
sdfgsd,0
fgsdfg,0
sfdgs,0

Iam getting like below output:
word,number,word_clean
NA,0,abc
NA,0,adf
NA,0,gfsgs
,0,
NA,0,sdfgsd
NA,0,fgsdfg
NA,0,sfdgs

I Want to get like below output:
word,number,word_clean
abc,0,abc
adf,0,adf
gfsgs,0,gfsgs
,0,
sdfgsd,0,sdfgsd
fgsdfg,0,fgsdfg
sfdgs,0,sfdgs
</code></pre>

<p>PLease suggest me.I think the issue is getting by this code [df.loc[df.iloc[:, column] == '', -1] = ''].</p>