Coder Social home page Coder Social logo

pybank-pypoll-big-data-analysis's Introduction

Python Data Analysis

By creating a script in Python, I have created a powerful option for handling big data. The datasets for the projects are intentionally large to showcase one of the limits of Excel-based analysis. Each project below has its own script for the analysis. The script can be found in the Project's folder. Within each projects folder is a copy of the original data, in the sub-folder Resources. An export of each analysis is available in a textfile in the sub-folder Analysis. Websites used to inform my script for each project can be found in the folder Support Documents.

Each project successfully reads a csv file, analyzes the data, and displays the results in the terminal and a textfile. Other features in the projects include for loops, defining functions, lists, dictionaries, if statements, addition assignment, and basic arithmetic.

PyBank

A financial records company needs help analyzing their budget. I was given the file, 'budget_data.csv', to analyze. The dataset contains two columns, 'Date' and 'Profit/Losses'. The goal of the project was to analyze the monthly data provided and calculate the following values:

  • The total number of months included in the dataset
  • The net total amount of 'Profit/Losses' over the entire period
  • The changes in the 'Profit/Losses' over the entire period, and then the average of those changes
  • The greatest increase in profits (date and amount) over the entire period
  • The greatest decrease in profits (date and amount) over the entire period

The analyses in this script can be updated when additional months are added into the dataset by re-running the script. Below is a capture of the output:

PyBank Results

PyPoll

A small-town needs help modernizing its vote-counting process. I was given a set of poll data ('election_data.csv') that had the following three columns: 'Voter ID', 'County', and 'Candidate'. The goal of the project was to create a Python script that would analyze the votes and calculate the following values:

  • The total number of votes cast
  • A complete list of candidates who received votes
  • The percentage of votes each candidate won
  • The total number of votes each candidate won
  • The winner of the election based on popular vote

Some key features of this script are that it is built so that it could accommodate future polls with a change of the dataset. The names of the candidates are taken from the data and stored in a list. The votes cast for each candidate are stored in a dictionary.

The code could be further improved to allow the user to select the data file that they are interested in collecting the results of poll data using a library such as tkinter. In tkinter, a pop-up window could be created that allows the user to select the file of interest and then provides the path to the file for use in the rest of the script.

These two projects were completed as a part of UTSA's Data Analysis and Visualization Certification.

Below is a capture of the output:

PyPoll Results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.