I have seen alot of papers where they convert network data into images, i am trying to do the same i got the 87 apps network data from kaggle. The data has three columns 'Source.IP', 'Destination.IP' and 'Payload' it looks like this
and when I convert this into an image (heatmap) it looks like this

On x-axis is source.ips and on y-axis is dest ip, i want to learn CNN for pay-load based traffic matrix classification. I tried generating heatmaps, since i am using pandas and matplotlib/seaborn to generate the graph i had to pivot the table because of repeated source/destination ips.
g1 = true_ele.groupby(["Destination.IP","Source.IP"], as_index=False)['Payload'].mean()
table = g1.pivot(index='Destination.IP',columns='Source.IP',values='Payload')
and to remove duplicate i decided to groupby the source/dest ips by payload which is not nice since i am loosing the data.
what i want to ask, is there a better way to generate images based on the data above so that i wont loose data and will be able to generate meanigfull images to learn CNN.

