edouardthom / ATPBetting

A strategy for tennis matches betting
429 stars 196 forks source link

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

Open obtim opened 5 years ago

obtim commented 5 years ago

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 commented 4 years ago

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

obtim commented 4 years ago

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

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

obtim commented 4 years ago

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 commented 4 years ago

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

Garagante commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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