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

Error during generating https://github.com/edouardthom/ATPBetting #2

Open
obtim opened this issue Dec 20, 2018 · 7 comments
Open

Error during generating https://github.com/edouardthom/ATPBetting #2

obtim opened this issue Dec 20, 2018 · 7 comments

Comments

@obtim
Copy link

obtim commented Dec 20, 2018

Got this error

$ python main.py Elo rankings computing... 5000 matches computed... 10000 matches computed... 15000 matches computed... 20000 matches computed... 25000 matches computed... 30000 matches computed... 35000 matches computed... 40000 matches computed... Traceback (most recent call last): File "main.py", line 54, in data.to_csv("../Generated Data/atp_data.csv",index=False) File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 1745, in to_csv formatter.save() File "C:\Python27\lib\site-packages\pandas\io\formats\csvs.py", line 171, in save self._save() File "C:\Python27\lib\site-packages\pandas\io\formats\csvs.py", line 286, in _save self._save_chunk(start_i, end_i) File "C:\Python27\lib\site-packages\pandas\io\formats\csvs.py", line 313, in _save_chunk self.cols, self.writer) File "pandas_libs\writers.pyx", line 81, in pandas._libs.writers.write_csv_rows UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 17: ordinal not in range(128)

@phil-hudson
Copy link

Looks like you are using python27 where as this project uses python3

@obtim
Copy link
Author

obtim commented Mar 20, 2020

Looks like you are using python27 where as this project uses python3

Thanks! Please generate requirements.txt and add them to repo!!

@obtim
Copy link
Author

obtim commented Mar 20, 2020

Another mistake(use python3)

PS C:\Helper\ATPBetting\Python> python main.py
Elo rankings computing...
5000 matches computed...
10000 matches computed...
15000 matches computed...
20000 matches computed...
25000 matches computed...
30000 matches computed...
35000 matches computed...
40000 matches computed...
Traceback (most recent call last):
File "main.py", line 64, in
data.Date = data.Date.apply(lambda x:datetime.strptime(x, '%Y-%m-%d'))
File "C:\Users\obtim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\series.py", line 3848, in
apply
mapped = lib.map_infer(values, f, convert=convert_dtype)
File "pandas_libs\lib.pyx", line 2329, in pandas._libs.lib.map_infer
File "main.py", line 64, in
data.Date = data.Date.apply(lambda x:datetime.strptime(x, '%Y-%m-%d'))
AttributeError: module 'datetime' has no attribute 'strptime'

@karolkens
Copy link

karolkens commented Mar 20, 2020

I think you have to change to datetime.datetime.strptime() in every lane. It works for me.

@Garagante
Copy link

I confirm that changing to datetime.datetime.strptime()works for me as well.

You might face the same error as well on the line : beg = datetime(2008,1,1). Simply change it to beg = datetime.datetime(2008,1,1) and it will be ok !

@hobocow
Copy link

hobocow commented Sep 22, 2020

anyone knows why it says " FileNotFoundError: [Errno 2] No such file or directory: '../Generated Data/atp_data.csv'" for me ? how do i get the atp data csv file ?

@AutoNaver
Copy link

Yeah, I got the same problem can't seem to find the /Generated Data/ folder. People were having the same issue here: https://www.kaggle.com/edouardthomas/beat-the-bookmakers-with-machine-learning-tennis#297371

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

No branches or pull requests

6 participants