EMR notebooks: Display / visualise data

0

We use managed EMR notebooks for analysis of data stored on S3 using Spark. However whenever we render any HTML data e.g. KeplerGL / JSON display etc, it renders the IPython object reference instead of the actual html content. This prevents us from visualising data easily using EMR notebooks. There are a lot of documented examples for matlabplotlib but we couldn't find anything for JSON / HTML / KeplerGL / Other geo visualisation libraries.

Example:

from IPython.display import JSON

JSON({
    'string': 'string',
    'array': [1, 2, 3],
    'bool': True,
    'object': {
        'foo': 'bar'
    }
})

Output:

<IPython.core.display.JSON object>

Similar question from Stackoverflow: https://stackoverflow.com/questions/66524337/produce-html-output-from-aws-emr-jupyter-notebook

Env details:

  1. Jupyterlab: Version 3.1.4
  2. EMR release label: emr-5.34.0 (also reproducible on emr-5.33.1)
preguntada hace 2 años373 visualizaciones
1 Respuesta
0

Did you try importing HTML? Your example only imports JSON.

from IPython.core.display import HTML

Then you can try:

display(HTML('<h1>Hello, world!</h1>'))

respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas