Hey DQ community, Please help me understand this lines of code.
I am trying to understand each line written in the function that plots correlation heatmap and I reached far up to the text formatting but I am not getting following lines of code, it is rounding up the values for correlation I guess but not able to follow it all the way.
# format the text in the plot to make it easier to read
for text in ax.texts:
t = float(text.get_text())
if -0.05 < t < 0.01:
Couple of things -
- Explain what you have understood in the code so far. Then point out what exactly confuses you.
- Debug the code -
2.1 Run the code, see the output image. Take a screenshot of the output or save the image locally.
2.2 Remove parts of the code that confuse you. Run the code again. Compare the output image to the one you saved previously. What differences do you see between the two? Focus on the difference and then focus on the lines of code you removed and try to understand what that line of code does. You can remove multiple lines or one-by-one for the comparison. But make sure that the code still runs.
Try to follow the above approach first.