[IPython-dev] How to display markdown text in DataFrame in Notebook

Dong Ta dongta.hds at gmail.com
Sat May 30 16:00:19 EDT 2015


Hi Matthias,

After reading your answer and the notebook, I still can't figure out how to
properly display markdown columns in a DataFrame.

Can you be more specific?

Thanks a lot.
-DT

On Sat, May 30, 2015 at 9:48 AM, Matthias Bussonnier <
bussonniermatthias at gmail.com> wrote:

>
> On May 30, 2015, at 03:59, Anton Akhmerov <anton.akhmerov at gmail.com>
> wrote:
>
> Somewhat paradoxically, there's no easy way to display markdown
> programmatically in ipython. You can manually create HTML out of
> markdown by using markdown2html filters from
> IPython.nbconvert.filters.
>
>
>
>
> For some reason people don’t try, or don’t read the doc:
>
> class o:
>     def _repr_markdown_(self):
>         return '[try it](https://try.jupyter.org)'
>
> o()
>
> And we support arbitrary mime type, the _repr_*_ that exist are here just
> for convenience.
>
> If you want a more systematic solution, I believe you could subclass
> the DataFrame
>
>
> Which is the bad solution also, register a display_formatter for a
> specific object type:
>
>
> https://nbviewer.jupyter.org/github/ipython/ipython-in-depth/blob/bigsplit/examples/IPython%20Kernel/Custom%20Display%20Logic.ipynb#Adding-IPython-display-support-to-existing-objects
>
>> M
>
>
>
> Best,
> Anton
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
>> M
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150530/61806f24/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2015-05-30 at 09.42.04.png
Type: image/png
Size: 37416 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150530/61806f24/attachment.png>


More information about the IPython-dev mailing list