Home > Net >  Producing a heatmap from a pandas dataframe with rows of the form (x,y,z), where z is intended to be
Producing a heatmap from a pandas dataframe with rows of the form (x,y,z), where z is intended to be

Time:10-01

Let's say I have a dataframe with this structure

Example dataframe content

and I intend to transform it into something like this (done laboriously and quite manually):

Example of heatmap

Is there a simple call to (say) a seaborn or plotly function that would do this? Something like

heatmap(df, x='Dose', y='Distance', z='Passrate')

or perhaps a simple way of restructuring the dataframe to facilitate using sns.heatmap or plotly's imshow, or similar? It seems strange to me that I cannot find a straightforward way of putting data formatted in this way into a high-level plotting function.

CodePudding user response:

Use example heatmap

  • Related