Quantcast
Channel: Data Science, Analytics and Big Data discussions - Topics tagged data_science
Viewing all articles
Browse latest Browse all 787

Data mart practie problem code causing error when imputing data

$
0
0

@kevinkingsman wrote:

Hey,
this is article link: https://www.analyticsvidhya.com/blog/2016/02/bigmart-sales-solution-top-20

I’m facing an error while trying to perform imputation for Item_Weight as suggested:(I’ve tried in python 2.7 and 3.6)
code:
data.loc[miss_bool,‘Item_Weight’] = data.loc[miss_bool,‘Item_Identifier’].apply(lambda x: item_avg_weight[x])

error:
C:\Users****************\envs\python27\lib\site-packages\pandas\core\indexes\base.pyc in get_loc(self, key, method, tolerance)
2525 return self._engine.get_loc(key)
2526 except KeyError:
-> 2527 return self._engine.get_loc(self._maybe_cast_indexer(key))
2528
2529 indexer = self.get_indexer([key], method=method, tolerance=tolerance)
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: ‘FDP10’

Any solution would be much appreciated: Thank you.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 787

Trending Articles