I've a dataset like this:
1 1 0.5378291300966559
1 2 0.5536607043661815
2 2 0.5524941673147428
1 3 0.5736584823908455
2 3 0.5759360071103211
3 3 0.5874347294745028
1 4 0.5926563715142762
2 4 0.5928230196644817
3 4 0.5994333962893011
4 4 0.6093211865348295
1 5 0.6073769581157649
2 5 0.6092100877680258
3 5 0.6138206865903788
4 5 0.6182646372625263
5 5 0.6275413842906343
The goal is to plot out a heatmap of the values where the first 2 columns are the axis and the 3rd is the value.
I've read them out so that it fits into the dataframe a pivoted it:
data_str = """1 1 0.5378291300966559
1 2 0.5536607043661815
2 2 0.5524941673147428
1 3 0.5736584823908455
2 3 0.5759360071103211
3 3 0.5874347294745028
1 4 0.5926563715142762
2 4 0.5928230196644817
3 4 0.5994333962893011
4 4 0.6093211865348295
1 5 0.6073769581157649
2 5 0.6092100877680258
3 5 0.6138206865903788
4 5 0.6182646372625263
5 5 0.6275413842906343""".split('\n')
import pandas as pd
data = [{'min':line.split()[0], 'max':line.split()[1], 'score':line.split()[2]} for line in data_str]
df = pd.DataFrame(data, dtype=float).pivot('min', 'max', 'score')
When I tried out the solution on https://stackoverflow.com/a/59173863/610569, it only showed a straight line like:
But what I am expecting is for it to plot out the triangle heatmap of the values I have in the score column. How should I go about the plotting that?