I would like to generate a matrix for my data analysis. At current I have a CSV file with multiple key value pairs which is looking similar to this (just a bit smaller than the original data set).
PL1 AL1 BL2
ABCGD 41 BAHDG 13 HANDD 57
KANSL 35 ABCGD 15 NAHDK 36
In the end I would like to have a matrix looking like this with 0 entries for everything that is not a hit:
PL1 AL1 BL2
ABCGD 41 15 0
KANSL 35 0 0
BAHDG 0 13 0
HANDD 0 0 57
NAHDK 0 0 36
I'm still fairly new to python and not quite sure how to approach this problem. I have transferred my CSV file already to a pandas dataframe and tried generating an array with numpy but the outcome wasn't quite looking how I expected it to be.
I hope you can help me to solve this problem. Thanks!