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

fix ZeroDivisionError: float division by zero - #140

Open
markroxor wants to merge 1 commit into
rkern:masterfrom
markroxor:master
Open

fix ZeroDivisionError: float division by zero#140
markroxor wants to merge 1 commit into
rkern:masterfrom
markroxor:master

Conversation

@markroxor

@markroxor markroxor commented Feb 28, 2019

Copy link
Copy Markdown

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