Spaces:
Runtime error
Runtime error
CognitiveScience
commited on
Commit
·
26be341
1
Parent(s):
ad20c05
Create celscis
Browse files
celscis
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Define a dictionary called celscilist
|
2 |
+
celscilist = {
|
3 |
+
'Anil Seth': { 'info': { 'views': 14187265 , 'link': "youtubelink", 'student': "studentname" } },
|
4 |
+
'Andrew Huberman 2': { 'info': { 'views': 620004 , 'link': "youtubelink", 'student': "studentname" } },
|
5 |
+
'Donald Hoffman': { 'info': { 'views': 2504274 , 'link': "youtubelink", 'student': "studentname" } },
|
6 |
+
'Doug Hofstadter': { 'info': { 'views': 75493 , 'link': "youtubelink", 'student': "studentname" } },
|
7 |
+
'Howard Gardner': { 'info': { 'views': 1508453 , 'link': "youtubelink", 'student': "studentname" } },
|
8 |
+
'Janelle Shane': { 'info': { 'views': 2755716 , 'link': "youtubelink", 'student': "studentname" } },
|
9 |
+
'Daniel Kahneman': { 'info': { 'views': 1274170 , 'link': "youtubelink", 'student': "studentname" } },
|
10 |
+
'Elizabeth Loftus': { 'info': { 'views': 2190333 , 'link': "youtubelink", 'student': "studentname" } },
|
11 |
+
'Elizabeth Loftus 2': { 'info': { 'views': 2975 , 'link': "youtubelink", 'student': "studentname" } },
|
12 |
+
'Patricia Churchland': { 'info': { 'views': 8026 , 'link': "youtubelink", 'student': "studentname" } },
|
13 |
+
'Bret Weinstein': { 'info': { 'views': 41610 , 'link': "youtubelink", 'student': "studentname" } },
|
14 |
+
'Andrew Huberman': { 'info': { 'views': 55561 , 'link': "youtubelink", 'student': "studentname" } },
|
15 |
+
'Tom Scott': { 'info': { 'views': 2555516 , 'link': "youtubelink", 'student': "studentname" } },
|
16 |
+
'Melanie Mitchell': { 'info': { 'views': 44875 , 'link': "youtubelink", 'student': "studentname" } },
|
17 |
+
'Jordan Peterson': { 'info': { 'views': 236000 , 'link': "youtubelink", 'student': "studentname" } },
|
18 |
+
'Timnit Gebru': { 'info': { 'views': 79338 , 'link': "youtubelink", 'student': "studentname" } },
|
19 |
+
'Amy Cuddy': { 'info': { 'views': 23700189 , 'link': "youtubelink", 'student': "studentname" } },
|
20 |
+
'Mihaly Csikszentmihalyi': { 'info': { 'views': 952791 , 'link': "youtubelink", 'student': "studentname" } },
|
21 |
+
'Martha Nussbaum': { 'info': { 'views': 41046 , 'link': "youtubelink", 'student': "studentname" } },
|
22 |
+
'Noam Chomsky': { 'info': { 'views': 26042 , 'link': "youtubelink", 'student': "studentname" } },
|
23 |
+
'Russell A Barkley': { 'info': { 'views': 786116 , 'link': "youtubelink", 'student': "studentname" } },
|
24 |
+
'Slavoj Žižek': { 'info': { 'views': 153187 , 'link': "youtubelink", 'student': "studentname" } },
|
25 |
+
'Nathaniel Drew': { 'info': { 'views': 126828 , 'link': "youtubelink", 'student': "studentname" } },
|
26 |
+
'Lara Boyd': { 'info': { 'views': 39097670 , 'link': "youtubelink", 'student': "studentname" } },
|
27 |
+
'Yuval Noah Harari': { 'info': { 'views': 439139 , 'link': "youtubelink", 'student': "studentname" } },
|
28 |
+
'Jordan Peterson 2': { 'info': { 'views': 672531 , 'link': "youtubelink", 'student': "studentname" } },
|
29 |
+
'Yuval Noah Harari 2': { 'info': { 'views': 1859772 , 'link': "youtubelink", 'student': "studentname" } },
|
30 |
+
'Joscha Bach': { 'info': { 'views': 528348 , 'link': "youtubelink", 'student': "studentname" } },
|
31 |
+
'Poppy Crum': { 'info': { 'views': 133328 , 'link': "youtubelink", 'student': "studentname" } },
|
32 |
+
'Ryan Holiday': { 'info': { 'views': 34846 , 'link': "youtubelink", 'student': "studentname" } },
|
33 |
+
'Marvin Chun': { 'info': { 'views': 76604 , 'link': "youtubelink", 'student': "studentname" } },
|
34 |
+
'Jim Davies': { 'info': { 'views': 27628 , 'link': "youtubelink", 'student': "studentname" } },
|
35 |
+
}
|
36 |
+
|
37 |
+
# Extract 'views' values into a list
|
38 |
+
views_list = [item['info']['views'] for item in celscilist.values()]
|
39 |
+
|
40 |
+
# Calculate the sum of 'views' values
|
41 |
+
def calculate_average(views_list):
|
42 |
+
sum = 0
|
43 |
+
for view in views_list:
|
44 |
+
sum += view
|
45 |
+
return sum / len(views_list)
|
46 |
+
|
47 |
+
# Define a class called Celsci
|
48 |
+
class Celsci:
|
49 |
+
@staticmethod
|
50 |
+
def iscelsci(x):
|
51 |
+
y = "Not Above Average: "
|
52 |
+
if x > calculate_average(views_list):
|
53 |
+
y = "Above Average: "
|
54 |
+
return y
|
55 |
+
|
56 |
+
@staticmethod
|
57 |
+
def iscelscinow(x):
|
58 |
+
y = "Not Above Average: "
|
59 |
+
if x > calculate_average(views_list):
|
60 |
+
y = "Above Average: "
|
61 |
+
return y
|
62 |
+
|
63 |
+
# Define a function called checkcelsci
|
64 |
+
def checkcelsci(x):
|
65 |
+
result = Celsci.iscelsci(celscilist[x]['info']['views'])
|
66 |
+
return result
|
67 |
+
|
68 |
+
# Find the maximum value in views_list
|
69 |
+
max_views = max(views_list)
|
70 |
+
|
71 |
+
# Define a function to find the key by views value
|
72 |
+
def find_key_by_views(obj, views_value):
|
73 |
+
for key, value in obj.items():
|
74 |
+
if value['info']['views'] == views_value:
|
75 |
+
return key
|
76 |
+
|
77 |
+
# Call the function with data and max_views as arguments
|
78 |
+
no1 = find_key_by_views(celscilist, max_views)
|
79 |
+
|
80 |
+
def celsciresult(celsciname):
|
81 |
+
# Print the results
|
82 |
+
print(celscilist[celsciname]['info']['views'], checkcelsci(celsciname), int(calculate_average(views_list)), no1, max_views)
|
83 |
+
|
84 |
+
# Define a function called print_celscilist
|
85 |
+
def print_celscilist(celscilist):
|
86 |
+
# Loop through each key and value in celscilist
|
87 |
+
for key, value in celscilist.items():
|
88 |
+
# Print the key and the views value
|
89 |
+
print(key, value['info']['views'], checkcelsci(key), int(calculate_average(views_list)), no1, max_views)
|
90 |
+
|
91 |
+
# Call the function with celscilist as an argument
|
92 |
+
#print_celscilist(celscilist)
|