Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported operand type(s) for /: 'str' and 'float' #23

Open
NCryptos opened this issue Aug 17, 2019 · 5 comments · May be fixed by #28
Open

Unsupported operand type(s) for /: 'str' and 'float' #23

NCryptos opened this issue Aug 17, 2019 · 5 comments · May be fixed by #28

Comments

@NCryptos
Copy link

Hi,

I cloned the repo, installed the required packages in a new conda environment and runned run.py without any changes to the code.

Getting an error in data_processing line 18; "unsupported operand type(s) for /: 'str' and 'float'"

python version 3.6.9
conda 4.7.11
windows 10 professional

@aseaver
Copy link

aseaver commented Sep 1, 2019

+1; I'm having the same issue. Installed the required packages via pip. It might also be worth noting that I get a dtype warning on line 11: "DtypeWarning: Columns (2,3,4,5,6) have mixed types. Specify dtype option on import or set low_memory=False."

pip v19.2.3
python v3.7.3
Windows 10 Home

@n19htmare
Copy link

Same, please help :-)

@stephankistner
Copy link

stephankistner commented Jan 19, 2020

If you re-run the script the base.batch_run() calls will append to existing csv's, thereby adding (strings of) headers in the middle of your dataset.
Delete the files in AIAlpha-master\sample_data\processed_data\autoencoder_data and try again.

Edit: Delete the CSVs in AIAlpha-master/sample_data/processed_data/price_bars/volume_bars

@jmjmjm123
Copy link

jmjmjm123 commented Jan 28, 2020

If you re-run the script the base.batch_run() calls will append to existing csv's, thereby adding (strings of) headers in the middle of your dataset.
Delete the files in AIAlpha-master\sample_data\processed_data\autoencoder_data and try again.

the same error still happens ~
sad!

@stephankistner
Copy link

If you re-run the script the base.batch_run() calls will append to existing csv's, thereby adding (strings of) headers in the middle of your dataset.
Delete the files in AIAlpha-master\sample_data\processed_data\autoencoder_data and try again.

the same error still happens ~
sad!

Delete the data in AIAlpha-master/sample_data/processed_data/price_bars/volume_bars . That should do the trick, otherwise go through the steps below.

Do you also get this warning: DtypeWarning: Columns (2,3,4,5,6) have mixed types. Specify dtype option on import or set low_memory=False. (or something similar). That would indicate that there are headers or other nonsense somewhere in the csv.

Do you have Jupyter-Notebooks or Spyder? I.e. data exploring tools? Try to open the CSV in a DataFrame to see if there are inconsistencies. E.g. forcing the values to floats by using .astype() functionality from Pandas.

heyrict added a commit to heyrict/AIAlpha that referenced this issue Jun 18, 2020
This will make headers recognized as data by pandoc in the next read.

Closes VivekPa#23.
@heyrict heyrict linked a pull request Jun 18, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants