Big _mart sell key error



To make a new feature of item_visibility_meanratio I have write the code given in the link
But I get an error of (’ fdw58’,‘occured at index 0’)
How to solve it


I am assuming you are working with python 3.x

and you are getting the error here…

data.loc[miss_bool,'Item_Visibility'] = data.loc[miss_bool,'Item_Identifier'].apply(lambda x: visibility_avg[x])

this error arises due to the face that this code is written in Python 2.x. To rectify this error, do the following

instead of this

lambda x: visibility_avg)


lambda x: visibility_avg.loc)


Thanks I have got the correct code