About the Data category

Clearly, data matters for trading. This category is for questions and discussions about concepts, code examples and new applications related to the chapters Market & Fundamental Data: Sources and Techniques and Alternative Data for Finance: Categories and Use Cases. Relevant topics include:

  • Sourcing and working with market data at various frequencies
  • The role of fundamentals for a trading strategy
  • Which new sources of signals have emerged during the alternative data revolution
  • Important categories and providers of alternative data
  • Evaluating how the burgeoning supply of alternative data can be used for trading

chapter 7 : 03_preparing_the_model_data
when i run this file , i got this : `KeyError Traceback (most recent call last)

in
1 with pd.HDFStore(DATA_STORE) as store:
----> 2 prices = (store[‘quandl/wiki/prices’]
3 .loc[idx[START:END, :], ohlcv]
4 .rename(columns=lambda x: x.replace(‘adj_’, ‘’))
5 .assign(volume=lambda x: x.volume.div(1000))

~/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/io/pytables.py in getitem(self, key)
519
520 def getitem(self, key):
→ 521 return self.get(key)
522
523 def setitem(self, key, value):

~/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/io/pytables.py in get(self, key)
717 group = self.get_node(key)
718 if group is None:
→ 719 raise KeyError(“No object named {key} in the file”.format(key=key))
720 return self._read_group(group)
721

KeyError: ‘No object named quandl/wiki/prices in the file’`

KeyError: ‘No object named quandl/wiki/prices in the file’`

Sorry for the late response, barely getting started on this platform. The error suggests that the wiki prices data set hasn’t been created yet - did you go through the steps outlined here: machine-learning-for-trading/create_datasets.ipynb at master · stefan-jansen/machine-learning-for-trading · GitHub?

yes i run the script create_datasets.ipynb , but still got that error

If you run

with pd.HDFStore('assets.h5') as store:
    print(store.info()

does the result contain the wiki price data? This assumes your are using the right path, in other words running this command in the data directory. If you see the data, then the path you used above (DATA_STORE) is not pointing to the right file - perhaps you organized your folders differently? If you do not see the file, you should revisit the steps in create_dataset.,

Thanks Stefan , i think i find the issue

1 Like