Skip to content

How to get Glue Interactive Session Notebook to show matplotlib plot?

0

Hello, does anyone know got to get matplotlib plot working in Glue Interactive Session Notebook (PySpark)? Thank you

asked 3 years ago1.3K views
1 Answer
2
Accepted Answer

The following code works, both in a AWS Glue Notebook or in a jupyter notebook using interactive sessions. hope this helps,

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

plt.clf()
df=sqlDF.toPandas()
plt.bar(df.DOLocationID, df.sum_total_amount)
%matplot plt
AWS
EXPERT
answered 2 years ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.