Skip to content

Commit 06c341e

Browse files
committed
Scatter plots - matplotlib series
1 parent 7dcbc3b commit 06c341e

File tree

17 files changed

+223
-0
lines changed

17 files changed

+223
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

07-Scatter Plots/2019-05-31-data.csv

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
view_count,likes,ratio
2+
8036001,324742,96.91
3+
9378067,562589,98.19
4+
2182066,273650,99.38
5+
6525864,94698,96.25
6+
9481284,582481,97.22
7+
1853121,89903,97.46
8+
2875684,183163,94.52
9+
483827,4864,91.53
10+
1677046,103227,97.52
11+
289756,2387,92.95
12+
2561907,237728,98.8
13+
468390,25346,98.34
14+
18977153,768968,98.73
15+
365731,5997,93.29
16+
680701,41543,97.99
17+
5748289,225966,99.17
18+
3575950,374937,97.69
19+
865788,31806,98.3
20+
5433739,389145,98.84
21+
3643458,369667,97.88
22+
247602,1516,89.18
23+
300443,25429,99.49
24+
313500,56891,98.35
25+
3525217,92948,95.29
26+
195072,23832,98.97
27+
142697,20708,98.91
28+
456783,2625,94.53
29+
601565,38792,98.34
30+
6021472,342044,97.54
31+
940583,14292,97.7
32+
446569,7557,97.15
33+
767900,11091,97.14
34+
5895810,98088,95.87
35+
381910,45178,99.21
36+
2468645,188315,98.73
37+
407859,19407,98.77
38+
846399,29308,95.93
39+
872092,27298,94.85
40+
1279718,98471,99.06
41+
1068377,92634,98.89
42+
4691951,164807,98.93
43+
1091006,55346,98.53
44+
891230,30612,88.39
45+
720734,35647,98.11
46+
1025214,19926,94.86
47+
505146,3309,59.69
48+
265430,2124,91.99
49+
3651318,283911,98.64
50+
1290212,201881,99.3
51+
420393,5434,95.99
52+
655107,21485,96.16
53+
1010207,23720,95.85
54+
777547,9167,94.46
55+
686703,34001,98.54
56+
1625877,62101,98.35
57+
2107926,59334,97.3
58+
1564214,81581,97.96
59+
2277765,53425,89.82
60+
1558609,95695,98.23
61+
1689305,88050,95.43
62+
3382856,74078,93.32
63+
4835746,276098,94.3
64+
248754,2041,90.75
65+
687182,63309,97.61
66+
751948,24359,98.3
67+
737756,23093,82.35
68+
964229,18898,86.34
69+
973121,22810,97.6
70+
575508,16975,94.75
71+
1114419,35208,94.3
72+
722956,21843,97.6
73+
1560200,38185,96.52
74+
281397,3706,91.53
75+
1122525,28232,97.23
76+
20650480,212862,91.88
77+
225207,1524,84.76
78+
598367,24260,94.51
79+
2117363,162960,99.12
80+
1233027,16400,88.81
81+
2566897,112005,54.67
82+
11907188,1234111,83.49
83+
1477059,36018,98.75
84+
292469,5656,92.71
85+
466862,47754,98.96
86+
1055798,46122,97.84
87+
1278142,26021,97.37
88+
1938747,16942,87.66
89+
338563,8416,96.46
90+
645274,17943,94.67
91+
730110,26868,92.31
92+
1521090,19761,86.6
93+
1719425,79646,98.33
94+
3028604,75484,97.22
95+
1236239,55409,96.0
96+
906642,14128,91.88
97+
1257902,20899,92.93
98+
1163635,30173,89.82
99+
1413936,90918,97.87
100+
709519,6013,95.14
101+
628111,41450,97.03
102+
2478832,143686,98.28
103+
2524598,32486,93.66
104+
821547,18708,97.31
105+
3016943,38294,95.76
106+
743575,20181,89.7
107+
919626,22114,95.84
108+
2536083,538376,99.6
109+
959442,13220,95.94
110+
2044159,41080,92.48
111+
1554417,67165,93.0
112+
2181022,180132,98.19
113+
1010899,13696,97.57
114+
2620663,72681,96.68
115+
5732609,189529,97.16
116+
1187273,73120,99.24
117+
1594532,85661,97.01
118+
8403016,294629,96.97
119+
5972754,133474,96.6
120+
6189511,267690,99.03
121+
1042734,23761,91.61
122+
9476773,417402,97.8
123+
8040754,789213,98.73
124+
2724624,88968,91.74
125+
1085592,27288,98.51
126+
3393417,219213,95.68
127+
16396012,208578,79.21
128+
3226905,19814,91.77
129+
6276301,286642,98.15
130+
647094,19753,89.98
131+
8081040,477122,98.81
132+
886934,29360,98.46
133+
1228396,29893,98.2
134+
697471,6452,94.85
135+
1605670,78364,96.63
136+
2056991,121925,98.44
137+
397981,6185,58.36
138+
2760289,106828,97.14
139+
3655043,54069,89.65
140+
10662064,320959,97.89
141+
3105500,108620,96.6
142+
2238691,48825,96.77
143+
1153518,25832,96.44
144+
686228,24882,96.57
145+
7523411,614901,98.87
146+
2641916,49354,95.78
147+
11657853,233343,97.82
148+
5932061,172195,95.91
149+
6313988,323119,98.18
150+
2850316,218273,98.14
151+
2620142,36637,93.99
152+
854120,54821,98.05
153+
13799864,317613,96.07
154+
906841,35315,98.09
155+
689607,20658,98.58
156+
441729,14901,99.0
157+
797800,14327,95.41
158+
1682016,75706,98.17
159+
1426251,57965,98.73
160+
2268534,91796,97.75
161+
750032,39406,98.19
162+
4272799,26229,98.03
163+
2449662,80825,97.54
164+
5988592,512483,99.4
165+
3662227,75552,97.46
166+
725964,42700,98.98
167+
1647440,111190,98.85
168+
985104,12721,96.5
169+
1665692,23961,92.37
170+
2051794,81790,96.64
171+
4112883,116481,93.46
172+
33297045,1293427,99.07
173+
1517628,19931,96.25
174+
1675692,18803,72.76
175+
3626738,173591,98.44
176+
1169663,7766,92.99
177+
446959,4923,89.48
178+
6995153,195994,96.69
179+
519706,18975,98.94
180+
4373224,169228,93.01
181+
4024087,73080,97.71
182+
731349,42205,98.52
183+
94366013,4539630,97.66
184+
2458132,34337,95.52
185+
1812670,17476,94.43
186+
2028445,158178,97.94
187+
1335703,12622,94.14
188+
938717,17120,97.26
189+
2926955,42554,97.73
190+
4018930,32919,82.1
191+
6439402,81148,51.58
192+
5665790,166892,96.95
193+
899728,28115,96.49
194+
2792057,206926,96.99
195+
12839663,722491,97.84
196+
5694139,146797,98.19
197+
1069693,3970,90.66
198+
590760,70454,99.18
199+
319347,1208,92.5
200+
27594927,1351963,96.4
201+
26993425,437561,97.42

07-Scatter Plots/demo.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from matplotlib import pyplot as plt
2+
import pandas as pd
3+
4+
data = pd.read_csv('2019-05-31-data.csv')
5+
view_count = data['view_count']
6+
likes = data['likes']
7+
ratio = data['ratio']
8+
9+
plt.scatter(view_count, likes, c=ratio, cmap='summer', edgecolor='black',
10+
linewidth=1, alpha=0.75)
11+
12+
cbar = plt.colorbar()
13+
cbar.set_label('Like/Dislike Ratio')
14+
15+
plt.xscale('log')
16+
plt.yscale('log')
17+
plt.title("Trending Youtube Videos")
18+
plt.xlabel('View Count')
19+
plt.ylabel('Total Likes')
20+
21+
plt.savefig('plot.png')
22+
plt.show()

07-Scatter Plots/plot.png

64.8 KB
Loading

0 commit comments

Comments
 (0)