Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 2.31 KB

README.md

File metadata and controls

48 lines (30 loc) · 2.31 KB

Project 1

If you haven't already, please read project notes.

Goal: First project setup, generate plot.

In this example, I will be showing you how to take a data file in CSV format (comma-separated values) and generate a chart with it. I will present one way to do it here, and a different way to do it in project2.

Project Setup:

  • Open a terminal window
  • Navigate to the project directory:

cd ~/STBS/Python/Projects/project1

  • Run the Project Setup Script: source work_here.sh

Using Jupyter Lab:

  • Jupyter lab allows you to have everything you need in one browser.
  • When you first launch jupyter lab, it should look something like this: jupyterlab start
  • There is a file explorer on the left-hand side, and a launcher on the right.
  • Launch a new terminal jupyterlab launcher
  • Double-click project1.py in the file explorer on the left to open it open_project
  • You can re-arrange the terminal window by dragging the terminal tab
  • I like mine at the bottom. jupyterlab_drag_tab jupyterlab_splitscreen
  • Having a split window like this makes it easier to edit the code you're working on, save changes, and test them. Just type python project1.py and hit enter to run the project. jupyterlab_run_project

Exercises:

  • Change the color and line style of the graphs
  • Add a title and axis labels
  • Replace inputs/data.csv with your own data. You can create a table in Excel (or Google Sheets) and export it as a csv.

Resources for the exercises:

Pandas plot function (for dataframes) API entry

Plotting with matplotlib.pyplot

Other Resources:

The Python Tutorial

Pandas read_csv function API entry