Skip to content

Instantly share code, notes, and snippets.

@0x48piraj
Created March 17, 2020 09:49
Show Gist options
  • Select an option

  • Save 0x48piraj/b49e6cd2d12e5225a141eea98cba7ff4 to your computer and use it in GitHub Desktop.

Select an option

Save 0x48piraj/b49e6cd2d12e5225a141eea98cba7ff4 to your computer and use it in GitHub Desktop.
Visualization of Indian Institutes of Technology (IITs) MCQ Question Paper Answers (https://medium.com/manipal/jee-mains-analysis-d89387d3a180)
1-1
2-2
3-2
4-3
5-4
6-1
7-2
8-3
9-2
10-3
11-4
12-3
13-2
14-4
15-2
16-2
17-3
18-1
19-3
20-1
21-4
22-3
23-1
24-2
25-4
26-3
27-1
28-1
29-4
30-1
31-4
32-3
33-1
34-4
35-1
36-3
37-3
38-2
39-2
40-1
41-4
42-3
43-2
44-3
45-2
46-4
47-1
48-4
49-1
50-1
51-4
52-3
53-3
54-3
55-3
56-1
57-2
58-4
59-2
60-3
61-1
62-2
63-3
64-4
65-4
66-1
67-2
68-4
69-2
70-4
71-1
72-1
73-1
74-1
75-3
76-4
77-2
78-1
79-2
80-2
81-2
82-2
83-3
84-4
85-4
86-4
87-3
88-4
89-2
90-4
1-3
2-1
3-3
4-3
5-1
6-3
7-1
8-2
9-2
10-3
11-4
12-4
13-2
14-1
15-2
16-3
17-2
18-1
19-1
20-1
21-2
22-4
23-4
24-3
25-2
26-2
27-2
28-3
29-1
30-2
31-3
32-1
33-1
34-3
35-1
36-1
37-3
38-3
39-4
40-1
41-4
42-1
43-2
44-4
45-3
46-2
47-2
48-4
49-3
50-4
51-3
52-1
53-1
54-3
55-1
56-4
57-2
58-1
59-2
60-1
61-1
62-4
63-3
64-2
65-1
66-2
67-4
68-1
69-3
70-2
71-1
72-3
73-1
74-2
75-2
76-1
77-1
78-2
79-3
80-4
81-4
82-4
83-2
84-2
85-3
86-4
87-4
88-3
89-2
90-3
1-2
2-3
3-4
4-2
5-3
6-3
7-4
8-3
9-2
10-3
11-2
12-3
13-3
14-2
15-2
16-4
17-4
18-2
19-4
20-4
21-3
22-4
23-3
24-3
25-4
26-3
27-1
28-4
29-1
30-2
31-1
32-2
33-2
34-3
35-2
36-1
37-4
38-2
39-2
40-2
41-2
42-1
43-4
44-3
45-1
46-2
47-3
48-2
49-3
50-4
51-1
52-3
53-1
54-3
55-2
56-3
57-1
58-3
59-3
60-1
61-1
62-4
63-4
64-2
65-3
66-1
67-4
68-2
69-2
70-2
71-1
72-1
73-2
74-3
75-1
76-3
77-2
78-3
79-4
80-3
81-4
82-1
83-1
84-2
85-3
86-4
87-2
88-4
89-1
90-1
1-3
2-4
3-4
4-2
5-2
6-3
7-2
8-2
9-1
10-3
11-1
12-2
13-3
14-4
15-2
16-3
17-3
18-3
19-4
20-3
21-4
22-2
23-4
24-1
25-4
26-4
27-3
28-1
29-2
30-4
31-3
32-1
33-3
34-4
35-1
36-1
37-3
38-3
39-1
40-2
41-1
42-4
43-3
44-2
45-4
46-3
47-2
48-1
49-2
50-3
51-1
52-4
53-4
54-4
55-2
56-4
57-2
58-2
59-1
60-2
61-3
62-3
63-3
64-3
65-3
66-4
67-3
68-2
69-2
70-1
71-3
72-1
73-2
74-3
75-4
76-4
77-1
78-3
79-2
80-3
81-1
82-2
83-3
84-1
85-2
86-1
87-2
88-1
89-2
90-4
1-1
2-3
3-4
4-1
5-3
6-3
7-4
8-1
9-3
10-1
11-3
12-4
13-1
14-4
15-3
16-1
17-1
18-3
19-2
20-3
21-2
22-3
23-2
24-2
25-4
26-2
27-3
28-1
29-4
30-2
31-1
32-2
33-3
34-2
35-1
36-1
37-3
38-1
39-2
40-4
41-3
42-2
43-2
44-1
45-4
46-2
47-2
48-1
49-4
50-2
51-2
52-4
53-4
54-3
55-1
56-1
57-4
58-1
59-1
60-3
61-2
62-4
63-3
64-2
65-1
66-4
67-2
68-1
69-2
70-2
71-2
72-2
73-1
74-4
75-2
76-3
77-3
78-4
79-1
80-1
81-2
82-3
83-3
84-3
85-2
86-1
87-4
88-2
89-2
90-3
1-3
2-2
3-3
4-3
5-2
6-3
7-2
8-1
9-3
10-1
11-3
12-2
13-2
14-1
15-3
16-2
17-4
18-3
19-1
20-2
21-3
22-4
23-2
24-1
25-4
26-2
27-1
28-3
29-3
30-1
31-4
32-1
33-3
34-4
35-4
36-2
37-2
38-2
39-1
40-1
41-3
42-4
43-1
44-2
45-4
46-2
47-4
48-2
49-3
50-1
51-1
52-1
53-2
54-4
55-4
56-3
57-2
58-1
59-3
60-1
61-1
62-3
63-3
64-4
65-3
66-2
67-1
68-2
69-2
70-3
71-1
72-4
73-3
74-4
75-3
76-4
77-3
78-4
79-3
80-3
81-4
82-4
83-4
84-3
85-1
86-1
87-4
88-1
89-1
90-4
1-1
2-2
3-3
4-4
5-1
6-4
7-1
8-2
9-1
10-4
11-3
12-1
13-3
14-3
15-4
16-4
17-4
18-1
19-3
20-3
21-1
22-4
23-3
24-1
25-2
26-4
27-1
28-1
29-1
30-2
31-2
32-3
33-4
34-1
35-4
36-3
37-3
38-4
39-2
40-3
41-4
42-3
43-3
44-4
45-1
46-1
47-2
48-2
49-2
50-3
51-4
52-2
53-2
54-1
55-2
56-4
57-4
58-3
59-2
60-2
61-3
62-4
63-1
64-2
65-4
66-4
67-4
68-2
69-2
70-3
71-2
72-2
73-3
74-2
75-2
76-2
77-4
78-3
79-4
80-2
81-1
82-3
83-2
84-4
85-4
86-2
87-4
88-3
89-4
90-3
"""from collections import Counter
import numpy as np
import matplotlib.pyplot as plt"""
#import pandas
from collections import Counter
f = open('201x.txt', 'r').read()
a = []
for i in [i.split("-")[1] for i in f.split()]:
if i == '1':
a.append('a')
elif i == '2':
a.append('b')
elif i == '3':
a.append('c')
elif i == '4':
a.append('d')
counts = Counter(a[30:])
width = 120 # Adjust to desired width
longest_key = max(len(key) for key in counts)
graph_width = width - longest_key - 2
widest = counts.most_common(1)[0][1]
scale = graph_width / float(widest)
for key, size in sorted(counts.items()):
print('{}: {}'.format(key, int(size * scale) * '*'))
"""
letter_counts = Counter(a)
df = pandas.DataFrame.from_dict(letter_counts, orient='index')
df.plot(kind='bar')
=============
letter_counts = Counter(a)
def plot_bar_from_counter(counter, ax=None):
#This function creates a bar plot from a counter.
#:param counter: This is a counter object, a dictionary with the item as the key
# and the frequency as the value
#:param ax: an axis of matplotlib
#:return: the axis wit the object in it
if ax is None:
fig = plt.figure()
ax = fig.add_subplot(111)
frequencies = counter.values()
names = counter.keys()
x_coordinates = np.arange(len(counter))
ax.bar(x_coordinates, frequencies, align='center')
ax.xaxis.set_major_locator(plt.FixedLocator(x_coordinates))
ax.xaxis.set_major_formatter(plt.FixedFormatter(names))
return ax
plot_bar_from_counter(letter_counts)
plt.show()"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment