File "user_code.py", line 37, in before_trading_start
p1_ma5 = get_stock_price(stock_list,prev_trade_day,5).groupby('code').mean()
File "pandas/core/panel.py", line 860, in groupby
return PanelGroupBy(self, function, axis=axis)
File "pandas/core/groupby.py", line 388, in __init__
level=level, sort=sort)
File "pandas/core/groupby.py", line 2148, in _get_grouper
in_axis, name, gpr = True, gpr, obj[gpr]
File "pandas/core/panel.py", line 270, in __getitem__
return super(Panel, self).__getitem__(key)
File "pandas/core/generic.py", line 1077, in __getitem__
return self._get_item_cache(item)
File "pandas/core/generic.py", line 1084, in _get_item_cache
values = self._data.get(item)
File "pandas/core/internals.py", line 2851, in get
loc = self.items.get_loc(item)
File "pandas/core/index.py", line 1572, in get_loc
return self._engine.get_loc(_values_from_object(key))
File "pandas/index.pyx", line 134, in pandas.index.IndexEngine.get_loc (pandas/index.c:3824)
File "pandas/index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas/index.c:3704)
File "pandas/hashtable.pyx", line 686, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12280)
File "pandas/hashtable.pyx", line 694, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12231)
KeyError: 'code'
怎么解决啊大神,一创运行不了