Data Analysis with Python Projects - Medical Data Visualizer

Tell us what’s happening:
Hi, can somebody please help me? any hint on why the decimal .0 is wiped out?
image

Your code so far
corr = df_heat.corr()
corr = corr.round(1)
corr = corr.astype(float, errors = ‘raise’)

i also tried
corr = df_heat.corr()
corr = corr.round(1)
corr = corr * 1.0

also what cmap does the heatmap use?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62

Challenge: Data Analysis with Python Projects - Medical Data Visualizer

Link to the challenge:

somebody help me please :sweat_smile: ,

You don’t have to round the correlation matrix as you can control the formatting of the heatmap that seaborn will generate; check the sns.heatmap() documentation. It’s happening because something (round probably, without seeing the rest of your code) is automagically converting floats like 0.0 to 0 as an int.

Debugging would be much easier with a link to a repl for the project.

Hi Jeremy, thanks for replying, i solved the 0.0 problem but i’m still getting differing elements problems.

here is my code if you want to take a look
medical_data_visualizer.py - boilerplate-medical-data-visualizer - Replit

I just forked and ran it and it passed all tests, so you must have fixed the problem.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.