Skip to content

Commit 8e36ddb

Browse files
committed
update exercise
1 parent 30c12ac commit 8e36ddb

File tree

1 file changed

+58
-16
lines changed

1 file changed

+58
-16
lines changed

1_Basics/15_Exercise_Basics.ipynb

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
{
5050
"cell_type": "code",
51-
"execution_count": 19,
51+
"execution_count": 7,
5252
"metadata": {},
5353
"outputs": [],
5454
"source": [
@@ -58,7 +58,7 @@
5858
" {'role': 'Data Scientist', 'skills': ['Python', 'R', 'Machine Learning', 'Deep Learning']},\n",
5959
" {'role': 'Machine Learning Engineer', 'skills': ['Python', 'TensorFlow', 'PyTorch', 'Scikit-Learn']},\n",
6060
" {'role': 'Data Engineer', 'skills': ['Python', 'Apache Spark', 'Hadoop', 'SQL']},\n",
61-
" {'role': 'Business Intelligence Analyst', 'skills': ['SQL', 'Tableau', 'Power BI', 'Excel']},\n",
61+
" {'role': 'Business Intelligence Analyst', 'skills': ['Python', 'SQL', 'Tableau', 'Power BI', 'Excel']},\n",
6262
" {'role': 'Quantitative Analyst', 'skills': ['R', 'Python', 'MATLAB', 'Statistics']},\n",
6363
" {'role': 'Operations Analyst', 'skills': ['Python', 'SQL', 'Data Visualization', 'Process Improvement']},\n",
6464
" {'role': 'Database Administrator', 'skills': ['SQL', 'Oracle', 'MySQL', 'Database Management']},\n",
@@ -86,6 +86,41 @@
8686
{
8787
"cell_type": "code",
8888
"execution_count": 20,
89+
"metadata": {},
90+
"outputs": [
91+
{
92+
"data": {
93+
"text/plain": [
94+
"['Data Analyst', 'Business Intelligence Analyst']"
95+
]
96+
},
97+
"execution_count": 20,
98+
"metadata": {},
99+
"output_type": "execute_result"
100+
}
101+
],
102+
"source": [
103+
"# Determine which jobs you're qualified for \n",
104+
"qualified_roles = []\n",
105+
"\n",
106+
"for job in job_roles:\n",
107+
" # Initialize qualified flag\n",
108+
" qualified = True\n",
109+
" # Go through each skill in the skills key\n",
110+
" for skill in my_skills:\n",
111+
" if skill not in job['skills']:\n",
112+
" qualified = False\n",
113+
" break\n",
114+
" if qualified:\n",
115+
" # Add the job dictionary to the qualified_jobs list\n",
116+
" qualified_roles.append(job['role'])\n",
117+
"\n",
118+
"qualified_roles"
119+
]
120+
},
121+
{
122+
"cell_type": "code",
123+
"execution_count": 18,
89124
"metadata": {
90125
"colab": {
91126
"base_uri": "https://localhost:8080/"
@@ -103,22 +138,29 @@
103138
"id": "_F6xhXQUiNX-",
104139
"outputId": "65dcc832-2e0a-4e87-cd80-ae65d187726d"
105140
},
106-
"outputs": [],
141+
"outputs": [
142+
{
143+
"data": {
144+
"text/plain": [
145+
"['Data Analyst', 'Business Intelligence Analyst']"
146+
]
147+
},
148+
"execution_count": 18,
149+
"metadata": {},
150+
"output_type": "execute_result"
151+
}
152+
],
107153
"source": [
108154
"# Determine which jobs you're qualified for \n",
109155
"qualified_roles = []\n",
110156
"\n",
111157
"for job in job_roles:\n",
112-
" # Initialize qualified flag\n",
113-
" qualified = True\n",
114-
" # Go through each skill in the skills key\n",
115-
" for skill in job['skills']:\n",
116-
" if skill not in my_skills:\n",
117-
" qualified = False\n",
118-
" break\n",
119-
" if qualified:\n",
120-
" # Add the job dictionary to the qualified_jobs list\n",
121-
" qualified_roles.append(job['role'])"
158+
" # Check if all required skills are in my_skills\n",
159+
" if all(skill in job['skills'] for skill in my_skills):\n",
160+
" # Add the job role to the qualified_roles list\n",
161+
" qualified_roles.append(job['role'])\n",
162+
"\n",
163+
"qualified_roles"
122164
]
123165
},
124166
{
@@ -136,7 +178,7 @@
136178
},
137179
{
138180
"cell_type": "code",
139-
"execution_count": 21,
181+
"execution_count": 14,
140182
"metadata": {},
141183
"outputs": [
142184
{
@@ -171,7 +213,7 @@
171213
},
172214
{
173215
"cell_type": "code",
174-
"execution_count": 22,
216+
"execution_count": 11,
175217
"metadata": {},
176218
"outputs": [
177219
{
@@ -207,7 +249,7 @@
207249
"name": "python",
208250
"nbconvert_exporter": "python",
209251
"pygments_lexer": "ipython3",
210-
"version": "3.9.19"
252+
"version": "3.11.9"
211253
}
212254
},
213255
"nbformat": 4,

0 commit comments

Comments
 (0)