def plot_correlation():
"""
Generate the Correlation heat map as a PNG
Parameters
----------
job_id: str
Returns
-------
image/png
"""
job_id = request.args.get('job_id')
if job_id is None:
return None
job = mongo_get_job(job_id)
s3_file_key = job['s3_file_key']
data = s3_to_df(s3_file_key)
fig = plot_correlation_fig(data)
correlation_plot = fig_to_png(fig)
response = make_response(correlation_plot.getvalue())
response.mimetype = 'image/png'
return response
评论列表
文章目录