ZeroDivisionError when viewing dataframes
See original GitHub issueDescription
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:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello, I just managed to reproduce the error when opening the Pandas variable explorer of the attached file. error.txt
@dalthviz, please try to reproduce and fix this one.