Skip to content

Python: Improve the discovery of the %view magic use in the Console to view Data Frames #5840

@petetronic

Description

@petetronic

Describe the issue:

Positron extended the % magics from ipython, including a %view magic syntax that allows the user to launch a "Data Explorer" view for a Data Frame variable from a Python Console. This is similar to the R Console's View() function.

New users to the product would benefit to know this helpful syntax exists, but it needs to be more discoverable beyond % completions (and the % completion text itself needs improvement).

In the beta documentation, this capabilities is briefly mentioned, but it would not be obvious for a new user to find this today:
https://positron.posit.co/data-explorer.html#open-a-dataframe-in-the-data-explorer

To open a new instance of the Data Explorer on a specific data frame, use one of the following methods:

Use the language runtime directly:
- Via Python: %view dataframe label

Ideas:

  • The first time a DataFrame variable is created in a statement executed in a Python Console session, the kernel could return an output with a comment advertising the %view capability. This comment could have some minimal formatting to make it clear it is instructional rather than a computation.

  • If this capability were broadly useful enough, the Python Kernel banner could mention it. Or, at least, it should mention the syntax of magics and also have better documentation about the magics.

  • If the Console had AI assistant capabilities, based on the data types in statements being executed, it could also suggest this magic.

  • "Data" types in the Variables pane already have a "Table" icon that launches a data frame in a Data Explorer. Tooltips could be added to these variables to help users discover the Console magic alternative to clicking on these in the Variables pane.

  • When a "Home" page exists in Help, it could mention this magic as a tip for Python.

  • When RStudio's view data frame icon is clicked in its Environment pane, it emits a View() call to the R Console. Is this something Positron would want to do to make the connection between the Console functionality and the UI?

Dismissed:

  • While the kernel could return a message to the UI on first usage, a "toast" notification could be annoying, and would require added complexity to support "Never" show this again. Unless someone where in a "tour" mode, this method would likely be annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions