0

I have a data set that has a somewhat strange layout of the data itself. it looks like this:

enter image description here

It's actually in csv format but I showed it above in excel for convenience.

so the x-axis values are located in the first column. The y-axis values are in the first row. Each blue cell is a data point, with the value in the cell representing an intensity. So the for the top left cell, the coordinates would be [0.000146,0,0]. The one below would be [0.000478,0,114]. I'm trying to figure out how to actually get this data plotted like a 2-D heatmap where the intensity is represented by the color, but haven't been able to do so so far. Any suggestions for how to go about doing this? I've looked at some matplotlib and pandas tutorials but they don't seem to address data formatted this way.

jainashish
  • 4,702
  • 5
  • 37
  • 48
  • https://stackoverflow.com/questions/12286607/making-heatmap-from-pandas-dataframe – Michael Gardner Sep 24 '19 at 04:25
  • This is useful, but I still don't know how to get the actual data into the dataframe to then be plotted. In that example, they are randomly generating values using abs(np.random.randn(5, 4)). But I need to somehow actually correctly take each cell in the example above and store it in the dataframe so that the index and column match up. – blitzmaster5000 Sep 25 '19 at 20:27

0 Answers0