I wrote two different specific questions that use my data, I used the poekmon lab to help A LOT.

I feel confident about what i wrote but I am stuck on the testing portion, everytime i try to test it says i must pick a kernel, but Im not sure what that is or how to do it or what to pick, I would love some assitance on this
This commit is contained in:
mollychi
2025-11-03 21:04:12 -05:00
parent c8a6985887
commit cd30ebdc37
2 changed files with 78 additions and 44 deletions

View File

@@ -13,7 +13,7 @@
"id": "understanding-numbers",
"metadata": {},
"source": [
"*✏️ Write 2-3 sentences describing your research.*"
"Learn about the different demographics that make swifties similar and different"
]
},
{
@@ -21,7 +21,7 @@
"id": "greater-circular",
"metadata": {},
"source": [
"## Overarching Question: [✏️ PUT YOUR QUESTION HERE ✏️]"
"## How similar are Taylor Swift Fans?"
]
},
{
@@ -29,7 +29,7 @@
"id": "appreciated-testimony",
"metadata": {},
"source": [
"*✏️ Write 2-3 sentences explaining why this question.*"
"As an advid Taylor Swift fan I want to learn more about the swiftie community"
]
},
{
@@ -61,10 +61,10 @@
"source": [
"### 💻 FILL IN YOUR DATASET FILE NAME BELOW 💻 ###\n",
"\n",
"file_name = \"YOUR_DATASET_FILE_NAME.csv\"\n",
"file_name = \"swiftie.csv\"\n",
"dataset_path = \"data/\" + file_name\n",
"\n",
"df = pd.read_csv(dataset_path)"
"swiftie = pd.read_csv(\"swiftie.csv\")"
]
},
{
@@ -74,7 +74,7 @@
"metadata": {},
"outputs": [],
"source": [
"df.head()"
"swiftie.head()"
]
},
{
@@ -84,7 +84,7 @@
"source": [
"**Data Overview**\n",
"\n",
"*✏️ Write 2-3 sentences describing this dataset. Be sure to include where the data comes from and what it contains.*"
"The data I have collected is on whether people are Taylor Swift fans and what their gender is, what their age range is, and what their poltical affiliation is to see if there are any partners or correlations"
]
},
{
@@ -110,7 +110,7 @@
"id": "recognized-positive",
"metadata": {},
"source": [
"## First Research Question: [✏️ PUT YOUR QUESTION HERE ✏️]\n"
"## First Research Question: What is the percent of democratic people in this survery are Taylor Swift fans?\n"
]
},
{
@@ -126,12 +126,11 @@
"id": "endless-variation",
"metadata": {},
"source": [
"*Explain how you will approach this research question below. Consider the following:* \n",
" - *Which aspects of the dataset will you use?* \n",
" - *How will you reorganize/store the data?* \n",
" - *What data science tools/functions will you use and why?* \n",
" \n",
"✏️ *Write your answer below:*\n",
"\n",
" - We will be utilizing the poltical stance column and the swiftie column\n",
" - We will create a table with just the democratic survery responders\n",
" - Then we will use the mean fuction on the swiftie colounm to see the percent of democratics are swifties\n",
"\n",
"\n"
]
},
@@ -145,26 +144,14 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"id": "negative-highlight",
"metadata": {},
"outputs": [],
"source": [
"#######################################################################\n",
"### 💻 YOUR WORK GOES HERE TO ANSWER THE FIRST RESEARCH QUESTION 💻 \n",
"### \n",
"### Your data analysis may include a statistic and/or a data visualization\n",
"#######################################################################"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "victorian-burning",
"metadata": {},
"outputs": [],
"source": [
"# 💻 YOU CAN ADD NEW CELLS WITH THE \"+\" BUTTON "
"dem = swiftie[swiftie.political_stance == \"dem\"]\n",
"dem\n",
"dem.Swiftie.mean()"
]
},
{
@@ -172,7 +159,7 @@
"id": "collectible-puppy",
"metadata": {},
"source": [
"## Second Research Question: [✏️ PUT YOUR QUESTION HERE ✏️]\n"
"## Second Research Question: What is the most common age and gender of Taylor Swift fans?\n"
]
},
{
@@ -188,12 +175,9 @@
"id": "incorporate-roller",
"metadata": {},
"source": [
"*Explain how you will approach this research question below. Consider the following:* \n",
" - *Which aspects of the dataset will you use?* \n",
" - *How will you reorganize/store the data?* \n",
" - *What data science tools/functions will you use and why?* \n",
"\n",
"✏️ *Write your answer below:*\n"
"- we will be utilizing the swiftie colounm, the age column, and the sex colounm\n",
"- We will create a table with just the Taylor Swift fans\n",
"- Then we will use a bar plot to graph the number of responses from each age group and gender "
]
},
{
@@ -206,21 +190,19 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"id": "pursuant-surrey",
"metadata": {},
"outputs": [],
"source": [
"#######################################################################\n",
"### 💻 YOUR WORK GOES HERE TO ANSWER THE SECOND RESEARCH QUESTION 💻 \n",
"###\n",
"### Your data analysis may include a statistic and/or a data visualization\n",
"#######################################################################"
"fan = swiftie[swiftie.Swiftie == \"TRUE\"]\n",
"sns.barplot(data=fan, x=\"sex\",y=\"age_range\", errprbar=None)\n",
"<Axes: xlabel='Sex', ylabel='count'>"
]
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"id": "located-night",
"metadata": {},
"outputs": [],

52
swiftie.csv Normal file
View File

@@ -0,0 +1,52 @@
Swiftie Demographics
,age_range,sex,political_stance,Swifitie
0,18-34,male,dem,TRUE
1,18-34,male,rep,FALSE
2,18-34,male,dem,TRUE
3,18-34,male,dem,TRUE
4,18-34,male,dem,TRUE
5,18-34,male,dem,TRUE
6,18-34,male,dem,TRUE
7,18-34,male,ind,TRUE
8,35-44,male,ind,TRUE
9,35-44,male,ind,TRUE
10,35-44,male,rep,TRUE
11,35-44,male,ind,FALSE
12,45-64,male,ind,FALSE
13,45-64,male,ind,FALSE
14,45-64,male,rep,FALSE
15,45-64,male,rep,FALSE
16,45-64,male,dem,TRUE
17,45-65,male,rep,FALSE
18,45-65,male,rep,FALSE
19,45-65,male,rep,FALSE
20,65-100,male,rep,FALSE
21,65-100,male,rep,FALSE
22,65-100,male,rep,FALSE
23,65-100,male,rep,FALSE
24,65-100,male,rep,FALSE
25,18-34,female,dem,TRUE
26,18-34,female,dem,TRUE
27,18-34,female,dem,TRUE
28,18-34,female,dem,TRUE
29,18-34,female,ind,TRUE
30,18-34,female,ind,TRUE
31,18-34,female,dem,TRUE
32,35-44,female,dem,TRUE
33,35-44,female,rep,TRUE
34,35-44,female,dem,FALSE
35,35-44,female,ind,TRUE
36,45-65,female,dem,TRUE
37,45-65,female,rep,FALSE
38,45-65,female,ind,TRUE
39,45-65,female,dem,FALSE
40,45-65,female,dem,FALSE
41,45-65,female,rep,FALSE
42,45-65,female,rep,FALSE
43,45-65,female,rep,FALSE
44,65-100,female,dem,TRUE
45,65-100,female,ind,TRUE
46,65-100,female,dem,FALSE
47,65-100,female,rep,FALSE
48,65-100,female,rep,FALSE
49,65-100,male,rep,FALSE
1 Swiftie Demographics
2 ,age_range,sex,political_stance,Swifitie
3 0,18-34,male,dem,TRUE
4 1,18-34,male,rep,FALSE
5 2,18-34,male,dem,TRUE
6 3,18-34,male,dem,TRUE
7 4,18-34,male,dem,TRUE
8 5,18-34,male,dem,TRUE
9 6,18-34,male,dem,TRUE
10 7,18-34,male,ind,TRUE
11 8,35-44,male,ind,TRUE
12 9,35-44,male,ind,TRUE
13 10,35-44,male,rep,TRUE
14 11,35-44,male,ind,FALSE
15 12,45-64,male,ind,FALSE
16 13,45-64,male,ind,FALSE
17 14,45-64,male,rep,FALSE
18 15,45-64,male,rep,FALSE
19 16,45-64,male,dem,TRUE
20 17,45-65,male,rep,FALSE
21 18,45-65,male,rep,FALSE
22 19,45-65,male,rep,FALSE
23 20,65-100,male,rep,FALSE
24 21,65-100,male,rep,FALSE
25 22,65-100,male,rep,FALSE
26 23,65-100,male,rep,FALSE
27 24,65-100,male,rep,FALSE
28 25,18-34,female,dem,TRUE
29 26,18-34,female,dem,TRUE
30 27,18-34,female,dem,TRUE
31 28,18-34,female,dem,TRUE
32 29,18-34,female,ind,TRUE
33 30,18-34,female,ind,TRUE
34 31,18-34,female,dem,TRUE
35 32,35-44,female,dem,TRUE
36 33,35-44,female,rep,TRUE
37 34,35-44,female,dem,FALSE
38 35,35-44,female,ind,TRUE
39 36,45-65,female,dem,TRUE
40 37,45-65,female,rep,FALSE
41 38,45-65,female,ind,TRUE
42 39,45-65,female,dem,FALSE
43 40,45-65,female,dem,FALSE
44 41,45-65,female,rep,FALSE
45 42,45-65,female,rep,FALSE
46 43,45-65,female,rep,FALSE
47 44,65-100,female,dem,TRUE
48 45,65-100,female,ind,TRUE
49 46,65-100,female,dem,FALSE
50 47,65-100,female,rep,FALSE
51 48,65-100,female,rep,FALSE
52 49,65-100,male,rep,FALSE