Skip to content

Commit 3b9ba0d

Browse files
committed
data viz docu for descriptions
1 parent 9cb7304 commit 3b9ba0d

File tree

2 files changed

+116
-197
lines changed

2 files changed

+116
-197
lines changed

Code/data_merge.ipynb

Lines changed: 36 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 39,
5+
"execution_count": 2,
66
"id": "5c245cbc-1ce5-4436-812d-e57fc5799bdd",
77
"metadata": {
88
"tags": []
99
},
1010
"outputs": [
11-
{
12-
"name": "stdout",
13-
"output_type": "stream",
14-
"text": [
15-
"/Users/macuser/Desktop/infovizrepo/ProjectGaze\n"
16-
]
17-
},
1811
{
1912
"data": {
2013
"text/plain": [
@@ -36,7 +29,7 @@
3629
" 'gaze_score']"
3730
]
3831
},
39-
"execution_count": 39,
32+
"execution_count": 2,
4033
"metadata": {},
4134
"output_type": "execute_result"
4235
}
@@ -74,117 +67,11 @@
7467
},
7568
{
7669
"cell_type": "code",
77-
"execution_count": 51,
70+
"execution_count": 3,
7871
"id": "dd93b7d4-c65e-4b3c-bc4d-2d2f029c8ac5",
7972
"metadata": {
8073
"tags": []
8174
},
82-
"outputs": [
83-
{
84-
"data": {
85-
"text/html": [
86-
"<div>\n",
87-
"<style scoped>\n",
88-
" .dataframe tbody tr th:only-of-type {\n",
89-
" vertical-align: middle;\n",
90-
" }\n",
91-
"\n",
92-
" .dataframe tbody tr th {\n",
93-
" vertical-align: top;\n",
94-
" }\n",
95-
"\n",
96-
" .dataframe thead th {\n",
97-
" text-align: right;\n",
98-
" }\n",
99-
"</style>\n",
100-
"<table border=\"1\" class=\"dataframe\">\n",
101-
" <thead>\n",
102-
" <tr style=\"text-align: right;\">\n",
103-
" <th></th>\n",
104-
" <th>imdbid</th>\n",
105-
" <th>Title</th>\n",
106-
" <th>Decade</th>\n",
107-
" <th>Genre</th>\n",
108-
" <th>Director</th>\n",
109-
" <th>year</th>\n",
110-
" <th>bechdel_rating</th>\n",
111-
" <th>male_percen</th>\n",
112-
" <th>nonmale_percentage</th>\n",
113-
" <th>dialogue_score</th>\n",
114-
" <th>bechdel_score</th>\n",
115-
" <th>count</th>\n",
116-
" <th>inappropriate_count</th>\n",
117-
" <th>descriptions_score</th>\n",
118-
" <th>_merge</th>\n",
119-
" <th>gaze_score</th>\n",
120-
" </tr>\n",
121-
" </thead>\n",
122-
" <tbody>\n",
123-
" <tr>\n",
124-
" <th>44</th>\n",
125-
" <td>87332</td>\n",
126-
" <td>Ghostbusters</td>\n",
127-
" <td>80s</td>\n",
128-
" <td>Fantasy</td>\n",
129-
" <td>Ivan Reitman</td>\n",
130-
" <td>1984</td>\n",
131-
" <td>2.0</td>\n",
132-
" <td>86.68</td>\n",
133-
" <td>13.32</td>\n",
134-
" <td>25.0</td>\n",
135-
" <td>13.33</td>\n",
136-
" <td>10</td>\n",
137-
" <td>0</td>\n",
138-
" <td>0.0</td>\n",
139-
" <td>both</td>\n",
140-
" <td>38.33</td>\n",
141-
" </tr>\n",
142-
" </tbody>\n",
143-
"</table>\n",
144-
"</div>"
145-
],
146-
"text/plain": [
147-
" imdbid Title Decade Genre Director year bechdel_rating \\\n",
148-
"44 87332 Ghostbusters 80s Fantasy Ivan Reitman 1984 2.0 \n",
149-
"\n",
150-
" male_percen nonmale_percentage dialogue_score bechdel_score count \\\n",
151-
"44 86.68 13.32 25.0 13.33 10 \n",
152-
"\n",
153-
" inappropriate_count descriptions_score _merge gaze_score \n",
154-
"44 0 0.0 both 38.33 "
155-
]
156-
},
157-
"execution_count": 51,
158-
"metadata": {},
159-
"output_type": "execute_result"
160-
}
161-
],
162-
"source": [
163-
"final_scores.drop_duplicates(subset=['Title'], inplace=True)\n"
164-
]
165-
},
166-
{
167-
"cell_type": "code",
168-
"execution_count": 52,
169-
"id": "5c2632e7-6c84-46a2-a0d3-c84fbd091013",
170-
"metadata": {
171-
"tags": []
172-
},
173-
"outputs": [],
174-
"source": [
175-
"#save\n",
176-
"os.mkdir(path+'/Data/final_scores')\n",
177-
"\n",
178-
"final_scores.to_csv(path+'/Data/final_scores/final_scores_df.csv')\n"
179-
]
180-
},
181-
{
182-
"cell_type": "code",
183-
"execution_count": 53,
184-
"id": "f1e9268a-bbff-4356-b0e4-ee1ccce5fb4f",
185-
"metadata": {
186-
"tags": []
187-
},
18875
"outputs": [
18976
{
19077
"data": {
@@ -496,11 +383,43 @@
496383
"[80 rows x 16 columns]"
497384
]
498385
},
499-
"execution_count": 53,
386+
"execution_count": 3,
500387
"metadata": {},
501388
"output_type": "execute_result"
502389
}
503390
],
391+
"source": [
392+
"final_scores.drop_duplicates(subset=['Title'], inplace=True)\n",
393+
"final_scores.sort_values(by=['year'])\n",
394+
"final_scores"
395+
]
396+
},
397+
{
398+
"cell_type": "code",
399+
"execution_count": 6,
400+
"id": "5c2632e7-6c84-46a2-a0d3-c84fbd091013",
401+
"metadata": {
402+
"tags": []
403+
},
404+
"outputs": [],
405+
"source": [
406+
"#save\n",
407+
"if not os.path.exists(path+'/Data/final_scores'):\n",
408+
" os.mkdir(path+'/Data/final_scores')\n",
409+
"\n",
410+
"\n",
411+
"\n",
412+
"final_scores.to_csv(path+'/Data/final_scores/final_scores_df.csv')\n"
413+
]
414+
},
415+
{
416+
"cell_type": "code",
417+
"execution_count": null,
418+
"id": "f1e9268a-bbff-4356-b0e4-ee1ccce5fb4f",
419+
"metadata": {
420+
"tags": []
421+
},
422+
"outputs": [],
504423
"source": [
505424
"final_scores"
506425
]

0 commit comments

Comments
 (0)