← Back to Projects
MkViewer - College Major Salary Analysis [Read-Only]
Initializing MkViewer...
README.md

πŸ“Š Project 72 β€” College Major Salary Analysis (Pandas)

README GENERATED BY AI

πŸ“Œ Overview

Project 72 is a data analysis script built with Python and pandas that explores salary trends across different undergraduate majors. Using a CSV dataset, the program identifies:

  • Majors with the highest and lowest starting salaries
  • Majors with the highest mid-career salaries
  • Low-risk majors (small salary spread over time)
  • High-potential majors (large salary growth over time)

This project focuses on practical data cleaning, analysis, and ranking techniques using pandas.


πŸ› οΈ Technologies Used

  • Python 3
  • pandas

πŸ“‚ Dataset Requirements

The script expects a file named data.csv in the same directory.

Required columns:

  • Undergraduate Major
  • Starting Median Salary
  • Mid-Career Median Salary
  • Mid-Career 90th Percentile Salary

Any rows containing missing values are automatically removed before analysis.


πŸ“ˆ What the Script Does

1. Data Cleaning

  • Loads the CSV file
  • Removes rows with missing data (dropna())

2. Salary Insights

  • Finds the highest starting median salary
  • Finds the highest mid-career median salary
  • Finds the lowest starting median salary

3. Risk vs Reward Analysis

  • Calculates a Spread value:

Spread = Mid-Career 90th Percentile Salary βˆ’ Starting Median Salary * Uses this spread to determine:

  • Top 5 Lowest Risk Majors (smallest spread)
  • Top 5 Highest Potential Majors (largest spread)

▢️ How to Run

  1. Install pandas if you don’t have it:

bash pip install pandas 2. Make sure data.csv is in the same folder as the script. 3. Run the script:

bash python main.py


πŸ“€ Output

The program prints a clear, readable summary directly to the console, showing:

  • Major names
  • Salary values
  • Salary change potential

🎯 Learning Goals

  • CSV data handling with pandas
  • Data cleaning (dropna)
  • Index-based analysis (idxmax, idxmin)
  • Sorting and ranking datasets
  • Real-world data insights using Python

πŸš€ Future Improvements

  • Visualizations using matplotlib or seaborn
  • Export results to a CSV or JSON file
  • Interactive CLI options
  • Salary normalization for inflation

πŸ“„ License

This project is open-source and intended for educational use.