View command to open DataFrame in Variable explorer
See original GitHub issueDescription
I come from R with RStudio and I’d like to integrate more Python in my workflow.
With Spyder, I have been able to make this easy. What I’ve found in Spyder + pandas is really cool and has helped me a bunch.
One feature that I think is comfortable from my previous workbench is the View
command, perhaps explore
makes more sense in Spyder environment… because of the Variable Explorer.
Say you have a table called my_df
, execute
In [7]: explore(my_df)
in the command line, instead of clicking on it in the Variable Explorer. Thus allowing your hands on the keyboard =)
I didn’t find a similar command here, so I’m taking the liberty to suggest it. Cheers.
Versions and main components
- Spyder Version: 3.2.1
- Python Version: 3.6.1
- Qt Version: 5.6.2
- PyQt Version: 5.6
- Operating system: Linux-Ubuntu16.04
Dependencies
IPython >=4.0 : 5.3.0 (OK) cython >=0.21 : 0.25.2 (OK) jedi >=0.9.0 : 0.10.2 (OK) nbconvert >=4.0 : 5.1.1 (OK) numpy >=1.7 : 1.12.1 (OK) pandas >=0.13.1 : 0.20.1 (OK) psutil >=0.3 : 5.2.2 (OK) pycodestyle >=2.3: 2.3.1 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.2.0 (OK) pylint >=0.25 : 1.6.4 (OK) qtconsole >=4.2.0: 4.3.0 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.5.6 (OK) sympy >=0.7.3 : 1.0 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:22 (15 by maintainers)
I think the best would be to have a spyder namespace for spyder magic to cleanly separate from ipython magic. something like
%spyder display df
or%spyder.display df
.What I would see is: In spyder:
spyder/plugins/variableexplorer
, define a new function to display a variable that is not in the variable explorer (for @akdor1154 suggestion) Or that finds the index of the object.spyder/plugins/ipythonconsole/widgets/shell.py
: register a newcall_handler
: eg.'display_variable': self.display_variable
that will send the received object (or object name if only the index is needed) to the variable explorer.In spyder-kernels:
MagicsManager.register_function
(in SpyderKernel I think this is accessed byself.shell.magics_manager.register_function
)display_variable
You can do the same in Spyder but it’ll give you a text-based representation of variables. What others are asking for here is the equivalent of the
view
command in R:https://www.statology.org/view-function-in-r/