question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZeroDivisionError when viewing dataframes

See original GitHub issue

Description

What steps will reproduce the problem?

Traceback

  File "C:\Users\mowang\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\dataframeeditor.py", line 341, in data
    return to_qvariant(self.get_bgcolor(index))
  File "C:\Users\mowang\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\dataframeeditor.py", line 288, in get_bgcolor
    (vmax - color_func(value)) / (vmax - vmin))
ZeroDivisionError: float division by zero

Versions

  • Spyder version: 4.0.1
  • Python version: 3.7.6
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies

atomicwrites >=1.2.0         :  1.3.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
cloudpickle >=0.5.0          :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
IPython >=4.0                :  7.12.0 (OK)
jedi =0.14.1                 :  0.14.1 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
numpydoc >=0.6.0             :  0.9.2 (OK)
pexpect >=4.4.0              :  4.8.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
psutil >=0.3                 :  5.6.7 (OK)
pygments >=2.0               :  2.5.2 (OK)
pylint >=0.25                :  2.4.4 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.7 (OK)
zmq >=17                     :  18.1.1 (OK)
qdarkstyle >=2.7             :  2.8 (OK)
qtawesome >=0.5.7            :  0.6.1 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
rtree >=0.8.3                :  0.9.3 (OK)
sphinx >=0.6.6               :  2.4.0 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
watchdog                     :  None (OK)
cython >=0.21                :  0.29.15 (OK)
matplotlib >=2.0.0           :  3.1.3 (OK)
numpy >=1.7                  :  1.18.1 (OK)
pandas >=0.13.1              :  0.25.1 (OK)
scipy >=0.17.0               :  1.4.1 (OK)
sympy >=0.7.3                :  1.5.1 (OK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Mar 13, 2020

Hello, I just managed to reproduce the error when opening the Pandas variable explorer of the attached file. error.txt

1reaction
ccordoba12commented, Mar 13, 2020

@dalthviz, please try to reproduce and fix this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why returning Zero Division Error instead of inf in dataframe?
If you are using the latest version of pandas, you should be able to divide by 0. I can run your code without...
Read more >
float division error while calculating percentile rank in pandas ...
[Solved]-ZeroDivisionError: float division error while calculating percentile rank in pandas dataframe-Pandas,Python ... One option is to simply replace NaN ...
Read more >
"try ... except ... else ... finally ..." in Python - nkmk note
For example, when division by zero is attempted, ZeroDivisionError is raised, and the process ends. ... By setting except <exception-name> as < ...
Read more >
Exception and Error Handling in Python - DataCamp
Let's see them one by one. ... objects in memory, then you will see OutofMemoryError (Source). ... ZeroDivisionError Traceback (most recent call last) ......
Read more >
How to Make Division by Zero to Zero in Python? - Finxter
In Python, division by zero generates the exception ZeroDivisionError: division by zero.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found