Python Homework - Py Me Up Charlie 616419

Python Homework - Py Me Up, Charlie

In this homework assignment, you'll be using the concepts you've learned to complete 2 Python Challenges, PyBank and PyPoll. Both of these challenges encompass a real-world situation where your Python scripting skills can be applied: analyzing financial records and election voting data. Your final scripts should read the datasets, perform the specified analyses, print the results to the terminal, and export the analysis as a text file.

Paper For Above instruction

Python Homework - Py Me Up, Charlie

The homework involves two main Python challenges: PyBank and PyPoll, which require analyzing datasets related to financial records and election results, respectively. The tasks are designed to solidify the student’s understanding of file input/output, data structures, and basic data analysis techniques using Python. Proper organization, coding practices, and output formatting are emphasized, with the goal of producing scripts that can process large datasets efficiently and correctly.

PyBank Challenge:

Students are provided with a CSV file named budget_data.csv located in the PyBank/Resources directory. This dataset contains monthly profit/loss figures with two columns: Date and Profit/Losses. The task requires creating a Python script to analyze this dataset to generate specific metrics: total months included, net total of profit/losses, average change in profits/losses between months, greatest increase and decrease in profits over the period, along with their corresponding dates. The script must print these results to the console and also save them into a text file.

PyPoll Challenge:

This challenge involves processing election vote data stored in election_data.csv. The data includes Voter ID, County, and Candidate for each vote. The script should calculate total votes, list of candidates, percentage and total votes for each candidate, and identify the winner based on the popular vote. The results are to be printed on the terminal and exported to a text file, formatted as indicated in the instructions. This analysis helps simulate a real election vote tallying process.

Hints and Considerations:

  • Use Python modules such as csv to read files, and familiarize yourself with data structures like lists and dictionaries for storing and processing data.
  • Break down tasks into smaller objectives, such as reading data, calculating totals, tracking changes, and formatting output.
  • Be mindful of large datasets; efficiency in code will help handle big data effectively.
  • Test scripts with different datasets to ensure robustness and correctness.
  • Commit your code regularly and push updates to GitHub to prevent data loss.

Assessment Criteria

Students will be evaluated based on:

  • Completion of all specified tasks
  • The clarity, coherence, and professionalism of the output
  • The script's ability to work with different datasets
  • Proper formatting and commenting in code
  • Adherence to submission instructions, including proper use of repositories and file structures.

Note

Throughout this assignment, students are encouraged to apply best practices in programming, utilize debugging, and seek help when necessary. This exercise aims to develop practical skills valuable in data analysis and scripting for real-world applications.

References

  • Roberts, M. (2018). Python for Data Analysis. O'Reilly Media.
  • McKinney, W. (2018). Python Data Science Handbook. O'Reilly Media.
  • Chapman, J. (2018). Automate the Boring Stuff with Python. No Starch Press.
  • Yevick, D., & Beyoğlu, S. (2021). Data-driven analysis with Python. Packt Publishing.
  • Taneja, S. (2019). Learning Python Data Analysis. Packt Publishing.
  • Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual. CreateSpace.
  • McCarthy, C., & Petri, M. (2020). Effective Python: 59 Specific Ways to Write Better Python. Addison-Wesley.
  • Hungry, M. (2016). Data Analysis with Python and Pandas. O'Reilly.
  • Seabold, S., & Perktold, J. (2010). Statsmodels: Econometric and statistical modeling with Python. Proceedings of the python in science conference.
  • Justin Palmer. (n.d.). d3-tip: Tooltips for d3.js. Retrieved from https://github.com/Caged/d3-tip