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.

View command to open DataFrame in Variable explorer

See original GitHub issue

Description

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:open
  • Created 6 years ago
  • Reactions:12
  • Comments:22 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
impact27commented, Nov 14, 2019

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:

  • in 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.
  • in spyder/plugins/ipythonconsole/widgets/shell.py: register a new call_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:

  • Register the magic with ipython MagicsManager.register_function (in SpyderKernel I think this is accessed by self.shell.magics_manager.register_function)
  • Send the data to be displayed to the frontend with a comm message to display_variable
2reactions
ccordoba12commented, Apr 17, 2022

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/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Viewing dataframes in Spyder using a command in its console
To view the contents of a Dataframe, you need to double-click on it in the Variable Explorer. Share.
Read more >
Variable Explorer — Spyder 5 documentation
For lists, the main Variable Explorer displays a preview of the first ten values. To see them all, double click the list to...
Read more >
A few newbie questions on variable explorer, sciview and ...
3) Can one customise some kind of shortcut for the "view as dataframe" right mouse operation? Thanks! Votes. 1. Share.
Read more >
Exploring data using Pandas - Geo-Python
You can do this most easily in Spyder by using the filesystem browser above the File/Variable explorer panel. Click on the file folder...
Read more >
Variable explorer - Deepnote docs
When displaying any Pandas DataFrame, Deepnote provides interactive controls that allow you explore your data without having to write any additional code: Add ......
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