Chapter 11 00_custom_bundle

Hi,
I’m stucked at runnning ‘stook_preprocessing.py’.

>     for sid, symbol in symbols.set_index('sid').symbol.items():
>             p = prices.loc[symbol]
>             p.to_hdf('stooq.h5', 'jp/{}'.format(sid), format='t')

returns error.

AttributeError Traceback (most recent call last)
/var/folders/c0/nmq6y7ps4bzbyh7q4j6lcr3c0000gn/T/ipykernel_190/3366824621.py in
13 end_date = dates.max()
14
—> 15 for sid, symbol in symbols.set_index(‘sid’).symbol.items():
16 p = prices.loc[symbol]
17 p.to_hdf(‘stooq.h5’, ‘jp/{}’.format(sid), format=‘t’)

~/opt/miniconda3/envs/ml4t/lib/python3.8/site-packages/pandas/core/generic.py in getattr(self, name)
5476 ):
5477 return self[name]
→ 5478 return object.getattribute(self, name)
5479
5480 def setattr(self, name: str, value) → None:

AttributeError: ‘DataFrame’ object has no attribute ‘symbol’

I apppreciate if someone help me.