** error message****
AssertionError: Lists differ: ['0.0[59 chars], ‘0.2’, ‘0.0’, ‘0.0’, ‘0.0’, ‘0.0’, ‘0.0’, '0[560 chars], ‘’] != ['0.0[59 chars], ‘0.3’, ‘0.0’, ‘0.0’, ‘0.0’, ‘0.0’, ‘0.0’, ‘0[548 chars]0.1’]
First differing element 9:
‘0.2’
‘0.3’
(etc…)
NOte - Changing matplotlib to 3.2.2 or other versions does not help
Thanks,
*** code so far **(
Draw Heat Map
def draw_heat_map():
# Clean the data
df_heat = df[
(df[“ap_lo”] < df[‘ap_hi’]) &
(df[‘height’] >= df[‘height’].quantile(0.025)) &
(df[‘height’] < df[‘height’].quantile(0.975)) &
(df[‘weight’] >= df[‘weight’].quantile(0.025)) &
(df[‘weight’] < df[‘weight’].quantile(0.975))
]
# Calculate the correlation matrix
corr = df_heat.corr()
# Generate a mask for the upper triangle
mask = np.triu(np.ones_like(df_heat.corr()))
# Set up the matplotlib figure
fig, ax = plt.subplots(figsize=(10,10))
# Draw the heatmap with 'sns.heatmap()'
sns.heatmap(corr, annot=True, mask=mask, fmt = '.1f', vmin = -.1, vmax = .25, square = True,
center=0,cbar_kws={'shrink':.45, 'format':'%.2f'})
# Do not modify the next two lines
fig.savefig('heatmap.png')
return fig
Your browser information:
Microsoft Edge
Microsoft Edge is up to date.
Version 87.0.664.66 (Official build) (64-bit)
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66
.
Challenge: Medical Data Visualizer
Link to the challenge: