tensortrade-org / tensortrade

An open source reinforcement learning framework for training, evaluating, and deploying robust trading agents.
https://discord.gg/ZZ7BGWh
Apache License 2.0
4.45k stars 1.01k forks source link

train_and_evaluate.ipynb ValueError: Input contains NaN, infinity or a value too large for dtype('float32'). #446

Open segatrade opened 2 years ago

segatrade commented 2 years ago

In tutorial: https://github.com/tensortrade-org/tensortrade/blob/master/examples/train_and_evaluate.ipynb Implement basic feature engineering sel.fit(X_train, precalculate_ground_truths(X_train, column='close')) we got: ValueError: Input contains NaN, infinity or a value too large for dtype('float32').

bhavithran1 commented 2 years ago

Maybe your data has NAN values. Try X_train.dropna()

Quentin168 commented 2 years ago

I also encountered this problem and tried X_train.dropna(), but problem still there, any more suggestions?

Zymoo commented 1 year ago

Hey, also encountered this when returned to my code after some time off.

In my case it seemed to be an issue with Bitcoin volume at certain exchanges when using CryptoDataDownload. Change to BTC-USDT on Binance Exchange resolved this issue.

Hope it might help!

newzapster commented 1 year ago

This issue is related to the datetime stamp of UNIX. I had to revise the cdd.py file.

Also had to add below line:

data = data.drop(labels="compsum", axis=1)