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.

DataFrames in Variable Explorer: Missings should have distinctive background color

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When opening a Pandas DataFrame with missing values in the Variable Explorer, the missings are displayed with red cell background, which is similar to the red background of the minimal values. So the missings are difficult to spot.

I suggest using a white background for the missings instead.

What steps reproduce the problem?

  1. df=pd.DataFrame([1,None,5,9])
  2. Open df in the Variable Explorer.

What is the expected output? What do you see instead?

I see screenshot-missings-in-variable-explorer

I expect the nan field to have a visually distinctive color, e.g. white.

Versions

  • Spyder version: 3.3.1
  • Python version: 3.7.0 64bits
  • Qt version: Qt 5.9.3
  • PyQt version: 5.9.2
  • Operating System name/version: Win7 64-bit

(everything from WinPython64-3.7.0.2)

Dependencies

Available on request.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jondocommented, Oct 10, 2018

That’s fine. I am simply using this patch against spyder\\widgets\\variableexplorer\\dataframeeditor.py for now:

@@ -228,6 +228,8 @@ class DataFrameModel(QAbstractTableModel):
         if not self.bgcolor_enabled:
             return
         value = self.get_value(index.row(), column-1)
+        if np.isnan(value):
+            return Qt.white
         if self.max_min_col[column - 1] is None:
             color = QColor(BACKGROUND_NONNUMBER_COLOR)
             if is_text_string(value):
0reactions
jondocommented, Oct 13, 2018

OK.

By the way, I wrote “the neutral color is already white” because I nearly could not distinguish the light grey from the white neighbor cells. Now I have found out why: I had my monitor’s contrast set too high.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is part of my dataset colored by spyder, and part is not?
If so, you need to know that the coloring is not available if the contents of your Dataframe are too large. This is...
Read more >
Variable Explorer — Spyder 5 documentation
You can deactivate the background color by unchecking the appropriate option in the viewer, which will happen automatically if the array is too...
Read more >
Data Explorer Package - RPubs
This package helps them to focus on understanding the data and gather insights that would otherwise remain hidden. It also aims to automate...
Read more >
Biogen-Inc/tidyCDISC: vignettes/dev03_Indv_Expl.Rmd - Rdrr.io
This tutorial will walk you through how to add / display additional events on the Individual Explorer Tab. Currently, the app supports events...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Changed to allow variables with the same name as the class in its static block ... Fixed color-scheme to not propagate to the...
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