Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

fix ZeroDivisionError: float division by zero #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix ZeroDivisionError: float division by zero #140

wants to merge 1 commit into from

Conversation

markroxor
Copy link

@markroxor markroxor commented Feb 28, 2019

While running python -m line_profiler file_name.py. I get this minor error which can be fixed with a harmless addition of 1e-6.

Traceback (most recent call last):
  File "/Users/mark/miniconda3/envs/.env/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/mark/miniconda3/envs/.env/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/mark/miniconda3/envs/.env/lib/python3.5/site-packages/line_profiler.py", line 422, in <module>
    main()
  File "/Users/mark/miniconda3/envs/.env/lib/python3.5/site-packages/line_profiler.py", line 419, in main
    show_text(lstats.timings, lstats.unit)
  File "/Users/mark/miniconda3/envs/.env/lib/python3.5/site-packages/line_profiler.py", line 259, in show_text
    output_unit=output_unit, stream=stream, stripzeros=stripzeros)
  File "/Users/mark/miniconda3/envs/.env/lib/python3.5/site-packages/line_profiler.py", line 228, in show_func
    '%5.1f' % (100 * time / total_time) )
ZeroDivisionError: float division by zero

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant