Repository Name: python-challenge
Description: The Python Challenge repository contains solutions to two ('Module 3 Challenge') Python challenges: PyBank and PyPoll. Both challenges simulate real-world scenarios where Python scripting skills are crucial for data analysis and automation tasks.
Project Structure:
-
PyBank:
- main.py: Python script for analyzing financial data.
- Resources: Folder containing the financial dataset (
budget_data.csv
). - Analysis: Folder containing the analysis results text file (
budget_analysis.txt
).
-
PyPoll:
- main.py: Python script for analyzing poll data.
- Resources: Folder containing the poll dataset (
election_data.csv
). - Analysis: Folder containing the analysis results text file (
election_analysis.txt
).
Instructions: Before running the scripts, follow these steps:
- Clone Repository: Clone this repository to your local machine using
git clone
. - Navigate to Repository: Open your terminal and navigate to the cloned repository directory.
- Run Scripts: Run each script separately by executing
python main.py
within the respective project directories (PyBank
andPyPoll
). - Verify Results: Check the analysis results in the corresponding
Analysis
folders.
Project Overview:
-
PyBank:
- Analyzes financial data to calculate total months, net total profit/loss, average change, and identifies the greatest increase and decrease in profits.
- Utilizes Python's
csv
module for reading CSV files and handles data using variables, lists, and dictionaries.
-
PyPoll:
- Modernizes a small, rural town's vote-counting process by analyzing poll data.
- Calculates total votes cast, lists of candidates who received votes, percentages of votes each candidate won, and determines the winner of the election based on popular vote.
- Utilizes Python's file handling capabilities and data structures like lists and dictionaries.
Considerations:
- Use the
csv
module to handle CSV files effectively. - Employ variables, lists, and dictionaries to store and manipulate data.
- Break down tasks into smaller objectives for efficient problem-solving.
- Debug code as needed to identify and fix errors.
- Ensure correct file paths for loading datasets and outputting analysis results.
Backup and Version Control:
- Regularly commit your work to maintain version history and back it up by pushing changes to GitHub.
Additional Notes:
- Each script operates independently, analyzing its respective dataset.
- Remember to review the
README.md
file within each project folder for specific instructions and details.
Code Source: The Python script development process heavily utilized the Xpert Learning Assistant platform, leveraging its vast knowledge base and interactive capabilities. Additionally, some cross-comparisons were made with ' ChatGPT to address specific challenges encountered during script development.
Contact Information: If you have any questions, suggestions, or encounter issues, feel free to reach out to me via email at ngalakevin@gmail.com.
Thank you for exploring my Python Challenge repository!