Pandas DataFrame data is mangled in Jupyter Notebook

Viewed 61

I have some nasty data (related to the log4shell vulnerability) in a dataframe. When I try to display that dataframe in a notebook, it looks like the data itself is causing some funky formatting. How can I get the notebook to just render the table without attempting to interpret any markdown or whatever it's doing in the data?

My dataframe:

df = pd.DataFrame({'a': ['${${::-j}}']})

The string '${${::-j}}' gets rendered as:

     { {::-j}}

OK, well I can't copy and paste it properly from the notebook. The first left curly brace has a box around it in the actual notebook, so the $s around it must be causing that. Looking at the generated HTML, it mentions MathML:

<td><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-19-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><merror><mtext>{</mtext></merror></math>" role="presentation" style="position: relative;"><span class="math" id="MathJax-Span-104" aria-hidden="true" style=""><span class="noError" id="MathJax-Span-105" style="display: inline-block;">{</span></span><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><merror><mtext>{</mtext></merror></math></span></span><script type="math/tex" id="MathJax-Element-19">{</script>{::-j}}</td>

Is there a way to disable this MathML stuff?

0 Answers
Related