'Scatter Plot Binary Data Color Coded Points from Data Labels

I'd like to use matplotlib.pyplot.scatter to create a scatter plot similar to the picture below from data in a dataframe with a header that is formatted similar to the table here where all the points for a given sample are colored based on the label in the first column of the data and a point is only plotted for each gene with a value of 1 - no point for the genes with a 0 value:

label gene a gene b gene c gene d
1 0 1 0 0
0 1 1 0 1
0 0 0 1 0
1 0 0 0 0
1 0 1 0 0

enter image description here

Note: my sample data does not match my sample scatter plot output.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source