spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.34k stars 1.62k forks source link

Feature: Support creating histograms and showing images for dataframes #21025

Open uprokevin opened 1 year ago

uprokevin commented 1 year ago

Glad that on UI side, Spyder 5 came back to Spyder 3 functionalities. (Spyder 4 was truly a regression..)

Still missing many good features of Spyder 3:

Histogram from Variable Explorer ( ie one can check easily things)

https://docs.spyder-ide.org/3/variableexplorer.html

image

uprokevin commented 1 year ago

image

dalthviz commented 1 year ago

Hi @pprokevin thank you for the feedback! I think the features mentioned are still available from the Variable Explorer context menu:

ve_ctx_menu

ve_ctx_menu_save_image

The only difference is that their order/placement on the context menu is different but from a quick local check seems like are working as expected 🤔. Checked locally using the latest Spyder 5 (version 5.4.3) and the following example code:

import numpy as np

a = np.random.randint(100, size =(50))
b = np.random.random((16, 16))

Are you having troubles using the context menu actions? What version of Spyder are you currently using?

Any other info to better understand the issue/feature request is greatly appreciated. Let us know!

uprokevin commented 1 year ago

@dalthviz : Ah ok sorry, it was there. Because I was checking on pandas dataframe.

@dalthviz @ccordoba12

Variable Explorer is the single feature that make Spyder stands apart from
       VSCode plugins, Pycharm, and Jupyter. (ie not so well integrated/easy accessible)

 Ability to explore more pandas dataframe columns (ie histogram, min/max)...       
    would be very attractive features for Data Science people... (ie attract more user base)
dalthviz commented 1 year ago

Thank you for the extra info @pprokevin ! So basically the idea will be to extend the support of the Histogram and Show image actions to dataframes, right?

uprokevin commented 1 year ago

@dalthviz : yes, exactly !!!!!!

      Right click on one pandas column ---> 
             histogram
             plot
             show

       Technically: 
              pick column name 
              numpy_array=  df[colselected].values 

As Said, only Spyder has this ability to interact Viusally with variable/dataframe At SAME time while coding:

  VScode, Pycharm : no plugin
  Jupyter: one need to write/excute code to get variable names and interact.

People using Spyder just to get this easy interactivity with data (ie Excel-Like).....

Honestly. Sp[yder 3 was a marvel in term of functionality (fortunately Spyder 5 came back closer to Spyder 3 in usage)....

jitseniesen commented 1 year ago

I created a prototype so that we can discuss what this should look like. Let me know what you think. If there are no reactions, I will turn the prototype into a PR.

I think it makes most sense to create a histogram from the columns of a dataframe. In the video, you can see that when I right-clicking on a cell of a dataframe in the Dataframe Editor and select the new "Histogram" item, Spyder shows a histogram of the column that the cell is in. If multiple cells are selected, the plot has multiple histograms.

I don't think that "show image" on a DataFrame is a common action, so I would propose not to implement this. If we do want to do this, we need to decide how images are normally stored in a data frame?

dataframe-video2

jitseniesen commented 1 year ago

Some points from the weekly developer call a few days ago: