Big _mart sell key error

machine_learning
python

#1

To make a new feature of item_visibility_meanratio I have write the code given in the link https://www.analyticsvidhya.com/blog/2016/02/bigmart-sales-solution-top-20/
But I get an error of (’ fdw58’,‘occured at index 0’)
How to solve it


#2

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)

do:

lambda x: visibility_avg.loc)


#3

Thanks I have got the correct code