GithubHelp home page GithubHelp logo

ecc-notacoder / python-best-practices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rcc-uchicago/python-best-practices

0.0 0.0 0.0 45 KB

RCC workshop: Best coding practices for Python projects

Python 100.00%

python-best-practices's Introduction

python-best-practices

RCC workshop: Best coding practices for Python projects

Exercise 2: Pizza Histogram Generator

The pizza histogram generator will aggregate counts of pizza types (sausage, cheese, etc.) from a CSV file and will generate a histogram displaying the total frequencies of each pizza type.

Getting Started

Fork this repository if you haven't already and then clone your version of the repository to your local device, replacing <YOUR_GITHUB_HANDLE> with your GitHub username:

$ git clone https://github.com/<YOUR_GITHUB_HANDLE>/python-best-practices.git
$ cd python-best-practices

Dependencies

If you do not have Python3 installed on your device, install it here. Install the additional dependencies required to run this script in one of two ways:

  1. pip install matplotlib==3.0.2
  2. pip install -r requirements.txt

Usage

To generate the pizza histogram with the only required input:

$ python pizza_histogram.py -i /path/to/input/data.csv

An example input.csv file is located at python-best-practices/pizza_orders.csv.

To generate the pizza histogram with customized arguments:

$ python pizza_histogram.py -i /path/to/input/data.csv -d False -s True -o histogram.png

See below table for description of arguments:

Argument Flag Description
input_data (required) -i The path to the CSV with pizza types and counts
display (optional) -d Whether or not to display the output histogram. Options are True or False. Default value is True.
save (optional) -s Whether or not to save the output histogram as a .png file. Options are True or False. Default value is True.
out_filename (optional) -o The filename you would like to save your output histogram as. Default value is orders.png.

python-best-practices's People

Contributors

callistac avatar doraszasz avatar ecc-notacoder avatar jorgeeariass avatar luisibanez avatar

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.