As far as I know, the kernel doesn't know anything about the open notebook. 
The notebook file might not even be on the same machine as the kernel.

But, dataframes should already be display'able in a nice way in the 
notebook. Is there something missing from the default functionality?

On Tuesday, July 11, 2017 at 5:52:46 PM UTC-5, Sterling Paramore wrote:
>
> Thanks Brian,
>
> I guess I wasn't clear enough.  I want to be able to execute code within a 
> cell that gets the JSON for the current notebook.  Here's the best I can do 
> currently.  It almost works, but I don't know how to get the name of the 
> current notebook:
>
> ```
> import nbformat
>
> fp = open('TheNameOfThisWorkbook.ipynb')
> nb = nbformat.read(fp, 4)
>
> for cell in nb['cells']:
>     print('---')
>     print(cell)
> ```
>
>
> On Tue, Jul 11, 2017 at 3:34 PM, Brian Granger <[email protected] 
> <javascript:>> wrote:
>
>> In the file browser of JupyterLab, right click on the file and "Open
>> With" the "Editor"
>>
>> On Tue, Jul 11, 2017 at 3:31 PM, Sterling Paramore <[email protected] 
>> <javascript:>> wrote:
>> > Is there a way to get the JSON representation of a notebook that is
>> > currently open that could be passed to nbformat?
>> >
>> > I'm trying to create a pandas dataframe from a markdown cell with a 
>> table in
>> > it.  This is kind of a hack workaround for having some way of easily 
>> editing
>> > and pretty-printing dataframes within a notebook.
>> >
>> > Thanks,
>> > Sterling
>> >
>> > --
>> > You received this message because you are subscribed to the Google 
>> Groups
>> > "Project Jupyter" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an
>> > email to [email protected] <javascript:>.
>> > To post to this group, send email to [email protected] 
>> <javascript:>.
>> > To view this discussion on the web visit
>> > 
>> https://groups.google.com/d/msgid/jupyter/9d0f6ae5-0e9a-4500-acba-51ead21f032c%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Brian E. Granger
>> Associate Professor of Physics and Data Science
>> Cal Poly State University, San Luis Obispo
>> @ellisonbg on Twitter and GitHub
>> [email protected] <javascript:> and [email protected] <javascript:>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/CAH4pYpTE4QjgjxzLZSoRh0OyJk8rYBFOQ2Bxt04Vo1feayRymA%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/d2b394a6-ddbe-4281-a10a-5ccd489dd5ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to