Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add %%python cell magic command #6

Open
robertbindar opened this issue Jan 21, 2021 · 0 comments
Open

Add %%python cell magic command #6

robertbindar opened this issue Jan 21, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@robertbindar
Copy link
Collaborator

robertbindar commented Jan 21, 2021

The use case I currently see for this magic command is to allow users to customize as much as possible the charts they can generate based on the last query result in a notebook. They can do this by either using some advanced features of the matplotlib library that we'll probably never be able to provide or by using a totally different charting library like Altair.

Initially this magic command should allow users to execute arbitrary python code in a notebook cell and the result of the last executed query should be present in the python context of this particular %%python cell.

Such a cell might look something like:

%%python
import altair as alt

# generate heatmap based on last query data
# last_select is a pandas DataFrame that kernel makes available for this cell
alt.Chart(last_select).mark_rect().encode(
    x='x:O',
    y='y:O',
    color='z:Q'
)
@LinuxJedi LinuxJedi added the enhancement New feature or request label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants