Created
January 4, 2018 05:31
-
-
Save dgadiraju/39ab42d29c28537525f3a71ab88585ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kgislData = open("C:\\kgisl.csv").read().splitlines() | |
countByDegree = {} | |
for i in kgislData: | |
degree = "Engineering" if(i.split("\t")[3] | |
in ["CSE", "IT", "ECE"]) \ | |
else "Non Engineering" | |
if(countByDegree.has_key(degree)): | |
countByDegree[degree] = countByDegree[degree] + 1 | |
else: | |
countByDegree[degree] = 1 #{"CSE" : 1} | |
for i in countByDegree: | |
print(i + "\t" + str(countByDegree[i])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment