stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
12.87k stars 4.11k forks source link

Stooq hd5 format can not be created #264

Closed schullino1 closed 1 year ago

schullino1 commented 1 year ago

ValueError: No objects to concatenate

This error occurs if it try to generate the file even though I have dowloaded the files in the correct directory. I even changed the Index names in the Files from and to ticker and name but still this mistake occurs. The problem is there are to many txt files with probably different Index names ....

schullino1 commented 1 year ago

in [8] line 181 prices = (pd.concat(prices, ignore_index=True) .rename(columns=str.lower) .set_index(['ticker', date_label]) .apply(lambda x: pd.to_numeric(x, errors='coerce')))

stefan-jansen commented 1 year ago

If there are not objects to concatenate this means that the files are not being read, probably because the names have changed since publication. Please keep in mind that the risk of using free data is that breaking changes can occur at any time. I would recommend comparing the names of downloaded files with what the code is expecting.