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년 전372회 조회
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>'))

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인