|
5 | 5 | "id": "764436ef", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | | - "# Lesson 10 Activity Solution: Working with Pandas" |
| 8 | + "# Lesson 10 activity solution: working with Pandas" |
9 | 9 | ] |
10 | 10 | }, |
11 | 11 | { |
12 | 12 | "cell_type": "markdown", |
13 | 13 | "id": "61077fda", |
14 | 14 | "metadata": {}, |
15 | 15 | "source": [ |
16 | | - "## Learning Objectives\n", |
| 16 | + "## Learning objectives\n", |
17 | 17 | "\n", |
18 | 18 | "By the end of this activity, you will be able to:\n", |
19 | 19 | "- Create Pandas Series and DataFrames\n", |
|
57 | 57 | "metadata": {}, |
58 | 58 | "source": [ |
59 | 59 | "---\n", |
60 | | - "## Problem 1: Creating Your First DataFrame\n", |
| 60 | + "## Problem 1: creating your first DataFrame\n", |
61 | 61 | "\n", |
62 | 62 | "**Scenario:** You're working at a bookstore and need to create a simple inventory system.\n", |
63 | 63 | "\n", |
|
244 | 244 | "metadata": {}, |
245 | 245 | "source": [ |
246 | 246 | "---\n", |
247 | | - "## Problem 2: Loading and Exploring Student Data\n", |
| 247 | + "## Problem 2: loading and exploring data\n", |
248 | 248 | "\n", |
249 | 249 | "**Scenario:** You're a teacher analyzing student performance data.\n", |
250 | 250 | "\n", |
|
255 | 255 | "4. Show descriptive statistics for numerical columns using `.describe()`\n", |
256 | 256 | "5. Find the average grade of all students\n", |
257 | 257 | "\n", |
258 | | - "Students data file avalible for download here: [students.csv](https://gperdrizet.github.io/FSA_devops/assets/notebooks/unit2/students.csv)" |
| 258 | + "Students data file avalible for download here: [students.csv](https://raw.githubusercontent.com/gperdrizet/FSA_devops/refs/heads/main/data/unit2/students.csv)" |
259 | 259 | ] |
260 | 260 | }, |
261 | 261 | { |
262 | 262 | "cell_type": "code", |
263 | | - "execution_count": 6, |
| 263 | + "execution_count": null, |
264 | 264 | "id": "5c564957", |
265 | 265 | "metadata": {}, |
266 | 266 | "outputs": [ |
|
274 | 274 | ], |
275 | 275 | "source": [ |
276 | 276 | "# Step 1: Load the CSV file\n", |
277 | | - "students_df = pd.read_csv('students.csv')\n", |
| 277 | + "url = 'https://raw.githubusercontent.com/gperdrizet/FSA_devops/refs/heads/main/data/unit2/students.csv'\n", |
| 278 | + "students_df = pd.read_csv(url)\n", |
278 | 279 | "print('Students data loaded successfully!')" |
279 | 280 | ] |
280 | 281 | }, |
|
584 | 585 | "metadata": {}, |
585 | 586 | "source": [ |
586 | 587 | "---\n", |
587 | | - "## Problem 3: Data Filtering and Selection\n", |
| 588 | + "## Problem 3: data filtering and selection\n", |
588 | 589 | "\n", |
589 | 590 | "**Scenario:** Continue working with the student data to find specific information.\n", |
590 | 591 | "\n", |
|
971 | 972 | "metadata": {}, |
972 | 973 | "source": [ |
973 | 974 | "---\n", |
974 | | - "## Problem 4: Sales Data Analysis\n", |
| 975 | + "## Problem 4: sales data analysis\n", |
975 | 976 | "\n", |
976 | 977 | "**Scenario:** You're analyzing sales data for an electronics store.\n", |
977 | 978 | "\n", |
|
982 | 983 | "4. Find the product with the highest total value\n", |
983 | 984 | "5. Calculate the grand total of all sales\n", |
984 | 985 | "\n", |
985 | | - "Sales data file avalible for download here: [sales.csv](https://gperdrizet.github.io/FSA_devops/assets/notebooks/unit2/sales.csv)" |
| 986 | + "Sales data file avalible for download here: [sales.csv](https://raw.githubusercontent.com/gperdrizet/FSA_devops/refs/heads/main/data/unit2/sales.csv)" |
986 | 987 | ] |
987 | 988 | }, |
988 | 989 | { |
989 | 990 | "cell_type": "code", |
990 | | - "execution_count": 16, |
| 991 | + "execution_count": null, |
991 | 992 | "id": "9d90ac54", |
992 | 993 | "metadata": {}, |
993 | 994 | "outputs": [ |
|
1081 | 1082 | ], |
1082 | 1083 | "source": [ |
1083 | 1084 | "# Step 1: Load the sales data\n", |
1084 | | - "sales_df = pd.read_csv('sales.csv')\n", |
| 1085 | + "url = 'https://raw.githubusercontent.com/gperdrizet/FSA_devops/refs/heads/main/data/unit2/sales.csv'\n", |
| 1086 | + "sales_df = pd.read_csv(url)\n", |
1085 | 1087 | "print('Sales data loaded:')\n", |
1086 | 1088 | "sales_df" |
1087 | 1089 | ] |
|
1321 | 1323 | "metadata": {}, |
1322 | 1324 | "source": [ |
1323 | 1325 | "---\n", |
1324 | | - "## Problem 5: Series Creation and Manipulation\n", |
| 1326 | + "## Problem 5: series creation and manipulation\n", |
1325 | 1327 | "\n", |
1326 | 1328 | "**Scenario:** Create and work with Pandas Series for daily temperature data.\n", |
1327 | 1329 | "\n", |
|
1484 | 1486 | "metadata": {}, |
1485 | 1487 | "source": [ |
1486 | 1488 | "---\n", |
1487 | | - "## Reflection Questions\n", |
| 1489 | + "## Reflection questions\n", |
1488 | 1490 | "\n", |
1489 | 1491 | "**1. What is the difference between a Pandas Series and a DataFrame?**\n", |
1490 | 1492 | "\n", |
|
1517 | 1519 | ], |
1518 | 1520 | "metadata": { |
1519 | 1521 | "kernelspec": { |
1520 | | - "display_name": ".venv", |
| 1522 | + "display_name": "Python 3", |
1521 | 1523 | "language": "python", |
1522 | 1524 | "name": "python3" |
1523 | 1525 | }, |
|
1531 | 1533 | "name": "python", |
1532 | 1534 | "nbconvert_exporter": "python", |
1533 | 1535 | "pygments_lexer": "ipython3", |
1534 | | - "version": "3.12.3" |
| 1536 | + "version": "3.12.12" |
1535 | 1537 | } |
1536 | 1538 | }, |
1537 | 1539 | "nbformat": 4, |
|
0 commit comments