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)
已提問 2 年前檢視次數 373 次
1 個回答
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>'))

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南