Created
March 6, 2025 18:48
-
-
Save fomightez/978e1203a4ffbaba37e76efe6ba027af to your computer and use it in GitHub Desktop.
In relation to [this Jupyter Discourse post](https://discourse.jupyter.org/t/how-to-execute-notebook-in-different-namespace/33532?u=fomightez)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"id": "fe020087-2a01-4968-9644-d354c15e4c14", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"x=3" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"id": "afeca5e6-4264-4ce1-9d19-0dca9e9bc5a9", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"%store -r y\n", | |
"print(f\"{y=}\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"id": "15ba052b-3eeb-45df-a697-bbdf6e323a61", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"y += 50" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"id": "606b480a-f60b-4d21-8e96-3184bcf1ef45", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"print(f\"{y=}\")" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3 (ipykernel)", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.10.16" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment