I tried your solution Wojjie as is in mysql console and it gave me unknown column Male. I tried it again with the Male and Female comparisons in single quotes, i.e Gender='Male' and Gender='Female' and it worked.
One odd thing of note, I tried this query in phpmyadmin and it failed. This worked though, same output as mysql console
SELECT party, SUM(gender='Male'))as Male, SUM(gender='Female')) as Female, state FROM results GROUP BY party, state;
Thanks again.