Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Gas Price Analyzer

A Python program that processes gas price data from 1993 to 2013 to perform various analyses, including calculating average prices, finding highest and lowest prices, and sorting prices. The program reads data from a text file (GasPrices.txt) and generates results and sorted files for further analysis.

Features

  • Yearly Average Price: Calculates and displays the average gas price for each year from 1993 to 2013.
  • Monthly Average Price: Calculates and displays the average gas price for each month over the entire dataset.
  • Highest and Lowest Prices Per Year: Identifies and displays the highest and lowest gas prices for each year.
  • Sorted Price Files:
    • Generates a file (lowToHigh.txt) with prices sorted from lowest to highest.
    • Generates a file (HighToLow.txt) with prices sorted from highest to lowest.

Technologies

  • Python: Used to process and analyze gas price data.
  • File Handling: Reads gas price data from a file and writes results to new files.
  • Data Analysis: Implements functions to compute averages, sort data, and extract insights.

How to Run

  1. Open the Python Source file (gas_prices.py) in Visual Studio Code.
  2. Run the project.

About This Project

This project was developed for my python programming class.