Skip to content

MANE 3351

Lecture 2

Classroom Management

Agenda

  • Questions
  • Review 1st day
  • Introduction to Python
  • Discuss lab today

Much of the lecture 2 material is a demonstration. Later in the course, we will learn these techniques.


Resources

Handouts


Assignments

GitHub Home Page


Git

git

Source


GitHub

gitHub

  • Source
  • Most laboratories will be distributed through gitHub
  • Classroom material may also be available through gitHub
  • Easiest approach is download on PC or Mac using gitHub Desktop (pre-installed in EACSB 2.102)

GitHub Desktop

gitHub Desktop

  • Source
  • Graphical interface that makes using GitHub very easy to use
  • Downloading MANE 3351 materials
    • First use: clone repository
    • Subsequent uses: pull repository (will update local material)
  • Please do not push
  • Demonstrate using Standard Normal Case 1 from Dr. Timmer GitHub Public Repository

Python with Jupyter Notebook

  • Standard Normal Case 1
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as sct
import math

a=0.5

x=np.linspace(-4,4,500)
y=sct.norm.pdf(x,0,1)
y2=0.0*x
maske =(x<a)

plt.plot(x,y,'b')
plt.fill_between(x,y,color='#666666',where=maske)
plt.plot(x,y2,'b')
plt.show()

answer=sct.norm.cdf(a,0,1)
print ("%8.6f" % (answer))

Methods for Acquiring Python Code

  1. Clone repository to local machine using GitHub Desktop
  2. Copy code from MANE 3351 Fall 2025 Public Repository
  3. Copy code from lecture notes

Comments about Python Installation

  • We will utilize Anaconda python that is pre-installed on lab computers
    • Discuss installing on personal computers
  • Dr. Timmer will utilize a conda environment so that configure for MANE 3351 is stored separately and doesn't possible corrupt other environments
  • Most of the time, Dr. Timmer will work from the command line on a Mac
  • Quick demonstration on both Mac and Windows

First 4 Lines

  • Imports allow external packages to be used
  • Most standard packages are included in the Anaconda installation
  • Matplotlib "is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, the Python and IPython shells, the Jupyter notebook, web application servers, and four graphical user interface toolkits"
  • NumPy "is the fundamental package for scientific computering with Python. It contains amont other things: 1). a powerfull N-dimensional array object, 2). sophisticated (broadcasting) functions, 3. tools for integrating C/C++ and Fortran code, and 4). usefull linear algebra, Fourier transform, and random number capabilities."
  • SciPy "is a Python-based ecosystem of open-source software for mathematics, science, and engineering. In particular, these are some of the core packages: NumPy, SciPy library, Matplotlib, IPython, Sympy, and pandas."
  • Math "provides access to the mathematical functions defined by the C standard."

Python Libraries


Numpy Linspace

Numpy Linspace

  • Source
  • Experiment with endpoint

scipy.stats.norm

scipy stats norm

Source


Matplotlib

matplotlib

Source