{"id":20345343,"url":"https://github.com/andrewjmack/pandas-challenge","last_synced_at":"2025-10-08T14:08:48.867Z","repository":{"id":227319892,"uuid":"771045477","full_name":"andrewjmack/pandas-challenge","owner":"andrewjmack","description":"March 2024 bootcamp challenge repo for Pandas module","archived":false,"fork":false,"pushed_at":"2024-03-19T02:02:24.000Z","size":511,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T15:47:45.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewjmack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-12T15:38:32.000Z","updated_at":"2024-03-16T16:27:36.000Z","dependencies_parsed_at":"2024-03-19T00:28:46.379Z","dependency_job_id":"011f65a8-d1e8-4e1d-be70-85f8e4cd007e","html_url":"https://github.com/andrewjmack/pandas-challenge","commit_stats":null,"previous_names":["andrewjmack/pandas-challenge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrewjmack/pandas-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjmack%2Fpandas-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjmack%2Fpandas-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjmack%2Fpandas-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjmack%2Fpandas-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewjmack","download_url":"https://codeload.github.com/andrewjmack/pandas-challenge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjmack%2Fpandas-challenge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259404443,"owners_count":22852191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T22:07:51.265Z","updated_at":"2025-10-08T14:08:43.833Z","avatar_url":"https://github.com/andrewjmack.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pandas-challenge\n\nBootcamp challenge repo for Pandas module\nAndrew Mack\nMarch 2024\n\n## Contents\n\n- README.md\n- PyCitySchools\n    - PyCitySchools.ipynb\n    - /Resources\n        - schools.csv\n        - students.csv\n\n## Sources\n\n- Snippets of initial starter code provided by the school\n\n- Class notes and lessons\n\n- To fix a type error in the Scores by School Spending section (which appeared to be caused by school-provided formatting code), this Stack Overflow Q\u0026A was referenced to recast the problematic column:\n    https://stackoverflow.com/questions/68289481/pandas-python-error-not-supported-between-instances-of-str-and-int-while\n\n- Jupyter Notebook formatting reference:\n    https://medium.com/analytics-vidhya/the-jupyter-notebook-formatting-guide-873ab39f765e\n\n## Challenge Details\n\nIn this assignment, you’ll create and manipulate Pandas DataFrames to analyze school and standardized test data.\n\nBackground\nYou are the new Chief Data Scientist for your city's school district. In this capacity, you'll be helping the school board and mayor make strategic decisions regarding future school budgets and priorities.\n\nAs a first task, you've been asked to analyze the district-wide standardized test results. You'll be given access to every student's math and reading scores, as well as various information on the schools they attend. Your task is to aggregate the data to showcase obvious trends in school performance.\n\nBefore You Begin\nCreate a new repository for this project called pandas-challenge. Do not add this homework to an existing repository.\n\nClone the new repository to your computer.\n\nInside your local Git repository, create a folder for this homework assignment and name it PyCitySchools.\n\nAdd your Jupyter notebook to this folder. This will be the main script to run for analysis.\n\nPush these changes to GitHub or GitLab.\n\nFiles\nDownload the following files to help you get started:\n\nModule 4 Challenge filesLinks to an external site.\n\nInstructions\nUsing Pandas and Jupyter Notebook, create a report that includes the following data. Your report must include a written description of at least two observable trends based on the data.\n\nHint: Check out the sample solution called PyCitySchools_starter.ipynb located in the .zip file to review the desired format for this assignment.\n\nDistrict Summary\nPerform the necessary calculations and then create a high-level snapshot of the district's key metrics in a DataFrame.\n\nInclude the following:\n\nTotal number of unique schools\n\nTotal students\n\nTotal budget\n\nAverage math score\n\nAverage reading score\n\n% passing math (the percentage of students who passed math)\n\n% passing reading (the percentage of students who passed reading)\n\n% overall passing (the percentage of students who passed math AND reading)\n\nSchool Summary\nPerform the necessary calculations and then create a DataFrame that summarizes key metrics about each school.\n\nInclude the following:\n\nSchool name\n\nSchool type\n\nTotal students\n\nTotal school budget\n\nPer student budget\n\nAverage math score\n\nAverage reading score\n\n% passing math (the percentage of students who passed math)\n\n% passing reading (the percentage of students who passed reading)\n\n% overall passing (the percentage of students who passed math AND reading)\n\nHighest-Performing Schools (by % Overall Passing)\nSort the schools by % Overall Passing in descending order and display the top 5 rows.\n\nSave the results in a DataFrame called \"top_schools\".\n\nLowest-Performing Schools (by % Overall Passing)\nSort the schools by % Overall Passing in ascending order and display the top 5 rows.\n\nSave the results in a DataFrame called \"bottom_schools\".\n\nMath Scores by Grade\nPerform the necessary calculations to create a DataFrame that lists the average math score for students of each grade level (9th, 10th, 11th, 12th) at each school.\n\nReading Scores by Grade\nCreate a DataFrame that lists the average reading score for students of each grade level (9th, 10th, 11th, 12th) at each school.\n\nScores by School Spending\nCreate a table that breaks down school performance based on average spending ranges (per student).\n\nUse the code provided below to create four bins with reasonable cutoff values to group school spending.\n\nspending_bins = [0, 585, 630, 645, 680]\nlabels = [\"\u003c$585\", \"$585-630\", \"$630-645\", \"$645-680\"]\nUse pd.cut to categorize spending based on the bins.\n\nUse the following code to then calculate mean scores per spending range.\n\nspending_math_scores = school_spending_df.groupby([\"Spending Ranges (Per Student)\"])[\"Average Math Score\"].mean()\nspending_reading_scores = school_spending_df.groupby([\"Spending Ranges (Per Student)\"])[\"Average Reading Score\"].mean()\nspending_passing_math = school_spending_df.groupby([\"Spending Ranges (Per Student)\"])[\"% Passing Math\"].mean()\nspending_passing_reading = school_spending_df.groupby([\"Spending Ranges (Per Student)\"])[\"% Passing Reading\"].mean()\noverall_passing_spending = school_spending_df.groupby([\"Spending Ranges (Per Student)\"])[\"% Overall Passing\"].mean()\nUse the scores above to create a DataFrame called spending_summary.\n\nInclude the following metrics in the table:\n\nAverage math score\n\nAverage reading score\n\n% passing math (the percentage of students who passed math)\n\n% passing reading (the percentage of students who passed reading)\n\n% overall passing (the percentage of students who passed math AND reading)\n\nScores by School Size\nUse the following code to bin the per_school_summary.\n\nsize_bins = [0, 1000, 2000, 5000]\nlabels = [\"Small (\u003c1000)\", \"Medium (1000-2000)\", \"Large (2000-5000)\"]\nUse pd.cut on the \"Total Students\" column of the per_school_summary DataFrame.\n\nCreate a DataFrame called size_summary that breaks down school performance based on school size (small, medium, or large).\n\nScores by School Type\nUse the per_school_summary DataFrame from the previous step to create a new DataFrame called type_summary.\n\nThis new DataFrame should show school performance based on the \"School Type\".\n\nRequirements\nDistrict Summary (20 points)\nCalculate the total number of unique schools (2 points)\nCalculate the total number of students (2 points)\nCalculate the total budget (2 points)\nCalculate the average (mean) math score (2 points)\nCalculate the average (mean) reading score (2 points)\nUse the code provided to calculate the percentage of students who passed math (2 points)\nCalculate the percentage of students who passed reading (2 points)\nUse the code provided to calculate the percentage of students that passed both math and reading (2 points)\nCreate a new DataFrame for the above calculations called district_summary (4 points)\nSchool Summary (20 points)\nUse the code provided to select the school type (2 points)\nCalculate the total student count (2 points)\nUse the code provided to calculate the per capita spending (2 points)\nCalculate the average test scores (2 points)\nCalculate the number of schools with math scores of 70 or higher (2 points)\nCalculate the number of schools with reading scores of 70 or higher (2 points)\nUse the provided code to calculate the schools that passed both math and reading with scores of 70 or higher (2 points)\nUse the provided code to calculate the passing rates (2 points)\nCreate a new DataFrame for the above calculations called per_school_summary (4 points)\nHighest-Performing Schools by Percentage of Overall Passing (5 points)\nSort the schools by % Overall Passing in descending order (2 points)\nSave the results to a DataFrame called top_schools (2 points)\nDisplay the first 5 rows (1 point)\nLowest-Performing Schools by Percentage of Overall Passing (5 points)\nSort the schools by % Overall Passing in ascending order (2 points)\nSave the results to a DataFrame called bottom_schools (2 points)\nDisplay the first 5 rows (1 point)\nMath Scores by Grade (10 points)\nUse the code provided to separate the data by grade (1 points)\nGroup by \"school_name\" and take the mean of each (4 points)\nUse the code to select only the math_score (1 points)\nCombine each of the scores above into single DataFrame called math_scores_by_grade (4 points)\nReading Scores by Grade (10 points)\nUse the code provided to separate the data by grade (1 points)\nGroup by \"school_name\" and take the mean of each (4 points)\nUse the code to select only the reading_score (1 points)\nCombine each of the scores above into single DataFrame called reading_scores_by_grade (4 points)\nScores by School Spending (5 points)\nUse pd.cut with the provided code to bin the data by the spending ranges (2 points)\nUse the code provided to calculate the averages (1 points)\nCreate the spending_summary DataFrame using the binned and averaged spending data (2 points)\nScores by School Size (5 points)\nUse pd.cut with the provided code to bin the data by the school sizes (2 points)\nUse the code provided to calculate the averages (1 points)\nCreate the size_summary DataFrame using the binned and averaged size data (2 points)\nScores by School Type (5 points)\nGroup the per_school_summary DataFrame by \"School Type\" and average the results (2 points)\nUse the code provided to select the new column data (1 point)\nCreate a new DataFrame called type_summary that uses the new column data (2 points)\nWritten Report (15 points)\nTo receive all points, the written report presents a cohesive written analysis that:\n\nSummarizes the analysis (5 points)\n\nDraws two correct conclusions or comparisons from the calculations (10 points)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjmack%2Fpandas-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjmack%2Fpandas-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjmack%2Fpandas-challenge/lists"}