Mar-14-2019, 04:23 AM
(This post was last modified: Mar-14-2019, 04:23 AM by theinzawoo.)
These are in panda df ,
agree={'1':'agree','0':"don't agree"}
list_agg=["anc_ir_fo_daily","anc_att_vac_neg", "anc_iodine","anc_danger_neg", "bf_firsthour", "bf_sixmonths_neg", "bf_prev_dehy_neg", "gen_ors_zinc" ]
I want to label list_agg with agree dictionary in looping
My code :
for x in list_agg:
df.x=df.x.map(agree)
when I run this code ,
Error like AttributeError:
'DataFrame' object has no attribute 'x'.
Please help also !
agree={'1':'agree','0':"don't agree"}
list_agg=["anc_ir_fo_daily","anc_att_vac_neg", "anc_iodine","anc_danger_neg", "bf_firsthour", "bf_sixmonths_neg", "bf_prev_dehy_neg", "gen_ors_zinc" ]
I want to label list_agg with agree dictionary in looping
My code :
for x in list_agg:
df.x=df.x.map(agree)
when I run this code ,
Error like AttributeError:
'DataFrame' object has no attribute 'x'.
Please help also !