Watch and track your favorite playlist.
Curated by: Everyday Data Science (140 videos)
Question: https://leetcode.com/problems/election-results/description/ SQL Schema: Create table if not exists Votes(voter varchar(30), candidate varchar(30)) Truncate table Votes insert into Votes (voter, candidate) values ('Kathy', 'None') insert into Votes (voter, candidate) values ('Charles', 'Ryan') insert into Votes (voter, candidate) values ('Charles', 'Christine') insert into Votes (voter, candidate) values ('Charles', 'Kathy') insert into Votes (voter, candidate) values ('Benjamin', 'Christine') insert into Votes (voter, candidate) values ('Anthony', 'Ryan') insert into Votes (voter, candidate) values ('Edward', 'Ryan') insert into Votes (voter, candidate) values ('Terry', 'None') insert into Votes (voter, candidate) values ('Evelyn', 'Kathy') insert into Votes (voter, candidate) values ('Arthur', 'Christine') Pandas Schema: data = [['Kathy', None], ['Charles', 'Ryan'], ['Charles', 'Christine'], ['Charles', 'Kathy'], ['Benjamin', 'Christine'], ['Anthony', 'Ryan'], ['Edward', 'Ryan'], ['Terry', None], ['Evelyn', 'Kathy'], ['Arthur', 'Christine']] votes = pd.DataFrame(data, columns=['voter', 'candidate']).astype({'voter':'object', 'candidate':'object'}) #datasciencequestions #leetcodesolutions #dataengineering