I searched for the time on screen of every character on Game Of Thrones. I found the information until season 3 only. Here's the result:
Last active
April 23, 2017 19:40
-
-
Save etra0/83cc025b78d1df91d35a9eedc51b034f to your computer and use it in GitHub Desktop.
GoT screen on time until season3
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains 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
actor;Season 1;Season 2;Season 3 | |
Petyr Baelish;28:53;20:51;10:16 | |
Theon Greyjoy;19:22;41:48;23:01 | |
Yara Greyjoy;0;9:20;2:30 | |
Arya Stark;33:47;38:06;28:18 | |
Robert Baratheon;29:38;0;0 | |
Benjen Stark;7:00;0;0 | |
Grand Maester Pycelle;16:20;8:19;3:59 | |
Brynden Tully;0;0;12:00 | |
Talisa Maegyr;0;13:49;18:36 | |
Tyrion Lannister;52:48;64:24;49:03 | |
Stannis Baratheon;0;19:59;16:46 | |
Daario Naharis;0;0;10:12 | |
Viserys Targaryen;20:15;0;0 | |
Renly Baratheon;11:42;13:44;0 | |
Walder Frey;3:09;0;9:17 | |
Robb Stark;28:18;30:14;28:40 | |
Eddard Stark;94:35;0;0 | |
Loras Tyrell;5:13;9:30;7:11 | |
Ramsay Snow;0;0;13:43 | |
Hot Pie;1:10;9:35;5:02 | |
Mance Rayder;0;0;6:22 | |
Catelyn Stark;47:40;23:36;19:58 | |
Beric Dondarion;0:31;0;10:36 | |
Syrio Forel;6:15;0;0 | |
Balon Greyjoy;0;5:41;2:17 | |
Edmure Tully;0;0;13:08 | |
Tormund Giantsbane;0;0;10:27 | |
Yoren;7:20;5:28;0 | |
Qyburn;0;0;7:16 | |
Melisandre;0;12:41;19:41 | |
Gilly;0;3:00;15:08 | |
Jeor Mormont;10:37;7:44;5:21 | |
Joffrey Baratheon;17:41;19:07;17:34 | |
Barristan Selmy;10:33;0;15:10 | |
Jon Snow;59:35;33:20;35:46 | |
Robin Arryn;4:37;0;0 | |
Maester Luwin;8:09;16:13;0 | |
Gendry;2:51;13:42;22:41 | |
Sandor Clegane;9:22;13:17;16:24 | |
Maester Aemon;5:21;0;1:28 | |
Sansa Stark;26:20;28:15;31:07 | |
Ros;8:20;10:22;3:30 | |
Jaqen H’qhar;0:17;7:58;0 | |
Lysa Arryn;7:03;0;0 | |
Jorah Mormont;31:13;18:33;22:32 | |
Samwell Tarly;22:24;12:05;27:17 | |
Shae;8:40;17:22;14:43 | |
Daenerys Targaryen;57:00;38:58;31:37 | |
Olenna Tyrell;0;0;14:54 | |
Roose Bolton;0;3:59;9:42 | |
Ygritte;0;16:23;26:32 | |
Rodrik Cassel;14:13;2:33;0 | |
Thoros of Myr;0;0;15:35 | |
Missandei;0;0;11:39 | |
Bronn;15:58;13:45;7:11 | |
Varys;22:47;0;18:05 | |
Khal Drogo;25:15;2:05;0 | |
Tywin Lannister;9:25;17:17;22:57 | |
Cersei Lannister;28:03;38:46;23:13 | |
Osha;8:07;10:56;11:10 | |
Davos Seaworth;0;21:30;22:30 | |
Margaery Tyrell;0;10:00;22:51 | |
Brienne of Tarth;0;18:51;20:47 | |
Bran Stark;27:02;13:52;17:02 | |
Jaime Lannister;19:56;14:55;36:34 |
This file contains 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
Season 1: | |
1. Eddard Stark 94:35 | |
2. Jon Snow 59:35 | |
3. Daenerys Targaryen 57:00 | |
4. Tyrion Lannister 52:48 | |
5. Catelyn Stark 47:40 | |
6. Arya Stark 33:47 | |
7. Jorah Mormont 31:13 | |
8. Robert Baratheon 29:38 | |
9. Petyr Baelish 28:53 | |
10. Robb Stark 28:18 | |
11. Cersei Lannister 28:03 | |
12. Bran Stark 27:02 | |
13. Sansa Stark 26:20 | |
14. Khal Drogo 25:15 | |
15. Varys 22:47 | |
16. Samwell Tarly 22:24 | |
17. Viserys Targaryen 20:15 | |
18. Jaime Lannister 19:56 | |
19. Theon Greyjoy 19:22 | |
20. Joffrey Baratheon 17:41 | |
21. Grand Maester Pycelle 16:20 | |
22. Bronn 15:58 | |
23. Rodrik Cassel 14:13 | |
24. Renly Baratheon 11:42 | |
25. Jeor Mormont 10:37 | |
26. Barristan Selmy 10:33 | |
27. Tywin Lannister 9:25 | |
28. Sandor Clegane 9:22 | |
29. Shae 8:40 | |
30. Ros 8:20 | |
31. Maester Luwin 8:09 | |
32. Osha 8:07 | |
33. Yoren 7:20 | |
34. Lysa Arryn 7:03 | |
35. Benjen Stark 7:00 | |
36. Syrio Forel - 6:15 | |
37. Maester Aemon 5:21 | |
38. Loras Tyrell 5:13 | |
39. Robin Arryn 4:37 | |
40. Walder Frey - 3:09 | |
41. Gendry 2:51 | |
42. Hot Pie - 1:10 | |
43. Beric Dondarion 0:31 * | |
44. Jaqen H’qhar 0:17 * | |
Season 2: | |
1. Tyrion Lannister - 64:24 | |
2. Theon Greyjoy 41:48 | |
3. Daenerys Targaryen 38:58 | |
4. Cersei Lannister 38:46 | |
5. Arya Stark - 38:06 | |
6. Jon Snow 33:20 | |
7. Robb Stark 30:14 | |
8. Sansa Stark 28:15 | |
9. Catelyn Stark 23:36 | |
10. Davos Seaworth 21:30 | |
11. Petyr Baelish 20:51 | |
12. Stannis Baratheon 19:59 | |
13. Joffrey Baratheon 19:07 | |
14. Brienne of Tarth 18:51 | |
15. Jorah Mormont 18:33 | |
16. Shae 17:22 | |
17. Tywin Lannister -17:17 | |
18 .Varys - 16:25 | |
19. Ygritte 16:23 | |
20. Maester Luwin 16:13 | |
21. Jaime Lannister 14:55 | |
22. Bran Stark 13:52 | |
23. Talisa Maegyr 13:49 | |
24. Bronn - 13:45 | |
25. Renly Baratheon 13:44 | |
26. Gendry 13:42 | |
27. Sandor Clegane 13:17 | |
28. Melisandre 12:41 | |
29. Samwell Tarly 12:05 | |
30. Osha 10:56 | |
31. Ros 10:22 | |
32. Margaery Tyrell 10:00 | |
33. Hot Pie 9:35 | |
34. Loras Tyrell 9:30 | |
35. Yara Greyjoy 9:20 | |
36. Grand Maester Pycelle 8:19 | |
37. Jaqen H’qhar 7:58 | |
38. Jeor Mormont 7:44 | |
39. Balon Greyjoy 5:41 | |
40. Yoren 5:28 | |
41. Roose Bolton 3:59 | |
42. Gilly 3:00 | |
42. Rodrik Cassel 2:33 | |
43. Khal Drogo 2:05 | |
Season 3: | |
1. Tyrion Lannister 49:03 | |
2. Jaime Lannister - 36:34 | |
3. Jon Snow 35:46 | |
4. Daenerys Targaryen - 31:37 | |
5. Sansa Stark 31:07 | |
6. Robb Stark 28:40 | |
7. Arya Stark 28:18 | |
8. Samwell Tarly 27:17 | |
9. Ygritte 26:32 | |
10. Cersei Lannister 23:13 | |
11. Theon Greyjoy 23:01 | |
12. Tywin Lannister 22:57 | |
13. Margaery Tyrell - 22:51 | |
14. Gendry 22:41 | |
15. Jorah Mormont 22:32 | |
16. Davos Seaworth 22:30 | |
17. Brienne of Tarth 20:47 | |
18. Catelyn Stark 19:58 | |
19. Melisandre 19:41 | |
20. Talisa Maegyr 18:36 | |
21. Varys 18:05 | |
22. Joffrey Baratheon 17:34 | |
23. Bran Stark 17:02 | |
24. Stannis Baratheon 16:46 | |
25. Sandor Clegane 16:24 | |
26. Thoros of Myr 15:35 | |
27. Barristan Selmy 15:10 | |
28. Gilly 15:08 | |
28. Olenna Tyrell 14:54 | |
29. Shae 14:43 | |
30. Ramsay Snow 13:43 | |
31. Edmure Tully 13:08 | |
32. Brynden Tully 12:00 | |
33. Missandei 11:39 | |
34. Osha 11:10 | |
35. Beric Dondarion 10:36 | |
36. Tormund Giantsbane 10:27 | |
37. Petyr Baelish 10:16 | |
38. Daario Naharis 10:12 | |
39. Roose Bolton 9:42 | |
40. Walder Frey 9:17 | |
41. Qyburn 7:16 | |
42. Bronn 7:11 | |
43. Loras Tyrell 7:11 | |
44. Mance Rayder 6:22 | |
45. Jeor Mormont 5:21 | |
46. Hot Pie 5:02 | |
47. Grand Maester Pycelle 3:59 | |
48. Ros 3:30 | |
49. Yara Greyjoy 2:30 | |
50. Balon Greyjoy 2:17 | |
51. Maester Aemon 1:28 |
This file contains 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
import re | |
FILE = "data.txt" | |
def parse_name(filename): | |
name_time_regex = re.compile(r"\d+\. ([\W\w]+?)(\d+:\d+)") | |
matches = dict() | |
curr_key = '' | |
with open(FILE) as f: | |
for line in f: | |
# verify if is a season | |
if re.match(r'[Ss]eason \d:', line): | |
curr_key = int(re.match(r'[Ss]eason (\d):', line).group(1)) | |
matches[curr_key] = [] | |
continue | |
match = name_time_regex.match(line) | |
if match: | |
matches[curr_key].append( | |
(match.group(1).replace("-", "").strip(), match.group(2)) | |
) | |
return matches | |
dataset = parse_name(FILE) | |
actors = dict() | |
for key in dataset: | |
for item in dataset[key]: | |
actor, time = item | |
if actor not in actors: | |
actors[actor] = ["0", "0", "0"] | |
actors[actor][key - 1] = time | |
with open("dataset.csv", "w") as f: | |
f.write("actor;Season 1;Season 2;Season 3\n") | |
for key in actors: | |
f.write("{0};{1}\n".format(key, ";".join(actors[key]))) |
This file contains 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
import matplotlib.pyplot as plt | |
import pandas as pd | |
plt.rcParams['figure.figsize'] = (10, 20) | |
plt.style.use("ggplot") | |
def time_to_float(value): | |
if value != "0": | |
hour, minute = list(map(int, value.split(":"))) | |
minute = minute/60 | |
return hour + minute | |
else: | |
return 0 | |
def float_to_time(value): | |
if value >= 1: | |
minute = int((value % int(value)) * 60) | |
hour = int(value) | |
return "{0}:{1}".format(hour, minute) | |
else: | |
return "0:{0}".format(int(value * 60)) | |
df = pd.read_csv("dataset.csv", sep=";") | |
for col in df.columns[1:]: | |
df[col] = df[col].map(time_to_float) | |
df['total'] = df['Season 1'] + df['Season 2'] + df['Season 3'] | |
df = df.sort_values(by="total") | |
fig = plt.figure() | |
ax = fig.add_subplot(111) | |
df.plot.barh(ax=ax, x='actor', y=df.columns[1:4], stacked=True, width=.6) | |
plt.xlabel("Horas en pantalla") | |
plt.ylabel("Actor") | |
plt.title("Tiempo de cada personaje en pantalla") | |
plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=1.0) | |
plt.savefig("out.png", dpi=300, format="png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment