A blog post for Washington State University’s Python Working Group Blog
This post is the first in a two-part series of introductory python talks for the start of the semester. The majority of this talk is based on Software Capentry’s Python Notice Inflammation lesson.
—
Watch the recording of the presentation here. Presentation by Sarah Murphy (sarah.y.murphy@wsu.edu). Data used in this lesson can be downloaded here. We will use the inflammation-01.csv file in the Data folder for this lesson.
Some vocabulary
- Library - Families of code. You can import these to give you extra tools
- Variable - A value with a name assigned to it.
- Function - A named group of code. Can be imported by itself or with a library.
- Arguments/Parameters - Variables or values given to a function.
Getting Python on your computer
- Download Python on it's own (https://www.python.org/downloads/
- I use Anaconda: https://www.anaconda.com/. This comes with Jupyter Notebook and Spyder. It also comes with a library manager (conda).
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Sep 10 11:58:43 2021 @author: smurphy """ weight_kg = 60 # Defining variables ## Includes letters, digits, and underscores ## Case sensitive ## 0weight, 1weight doesnt work, can't start with a number # floating point number floatingnumber = 60.2 floatingnumber_2 = 60.0 # integer integernumber = 60 # strings stringnumber = '20' weight_lb = 2.2 * weight_kg print('The weight in kg is ', weight_kg) print(type(weight_kg)) print(type(stringnumber)) import numpy text_file = numpy.loadtxt(fname = '/Users/smurphy/swc-python/data/inflammation-01.csv', delimiter = ',') import matplotlib.pyplot as plt plt.plot(text_file[:,0])

References
- Dataset and rough outline of code comes from the Software Carpentry lesson (https://swcarpentry.github.io/python-novice-inflammation/)
- Lesson primarily from the Python Fundamentals lesson, vocabulary from the Reference section.