I cant fix that error
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
Cell In[17], line 1
----> 1 data_files = osulearn.dataset.all_files(OSU_FOLDER, verbose=True)
3 if not os.path.exists('.data'):
4 os.makedirs('.data')
File c:\Users\danil\OneDrive\Desktop\OsuLearn-master\OsuLearn-master\osulearn\dataset.py:41, in all_files(osu_path, limit, verbose)
39 for i in range(len(replays)-1, -1, -1):
40 if verbose:
---> 41 _print_progress_bar(replays, i, reverse=True)
43 beatmap = _get_replay_beatmap_file(osu_path, replays[i])
45 if beatmap is None:
File c:\Users\danil\OneDrive\Desktop\OsuLearn-master\OsuLearn-master\osulearn\_cli.py:4, in _print_progress_bar(collection, index, bar_width, buffer_width, reverse)
1 def _print_progress_bar(collection, index, bar_width=40, buffer_width=80, reverse=False):
2 bar_format = "\r[{done}>{todo}] {text}"
----> 4 progress = index / (len(collection) - 1)
5 if reverse:
6 progress = 1 - progress
ZeroDivisionError: division by zero
I dont know how to fix it, i tried to find in google but nothing found
>Solution :
It seems that the expression
progress = index / (len(collection) - 1)
directly part this part len(collection) - 1 in case that collection has size 1, it generates ZeroDivisionError.
You have to increate sice of collection (> one item) and all will be correct.