Skip to content

MANE 3351

Lecture 3, August 30

Classroom Management

Agenda

  • Attendance
  • Textbook

Resources

Handouts


Calendar

LectureDate Content
1August 23Welcome to Class, Syllabus
2August 25Error Analysis
3August 30Introduction to Jupyter Notebook

Assignments

  • Set up PC to run Jupyter Notebook

Git

git

Source


GitHub

gitHub

  • Source
  • Classroom lecture materials will be available at http://github.com/douglastimmer/MANE3351_Fall2021
  • Easiest approach is download on PC or Mac using gitHub Desktop
  • For Raspberry Pi, git must be used (command line)
  • Laboratories will be handled slightly differently (more later)

GitHub Desktop

gitHub Desktop

  • Source
  • Graphical interface that makes using GitHub very easy to use
  • Downloading lecture materials
    • First use: clone repository
    • Subsequent uses: pull repository (will update local material)
  • Please do not push

Python with Jupyter Notebook

Anaconda


GitHub Demonstration


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))

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"[^1]
  • 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."[^2]
  • 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."[^3]
  • Math "provides access to the mathematical functions defined by the C standard.

Python Libraries


Numpy Linspace

Numpy Linspace

  • [Source]((https://numpy.org/doc/stable/reference/generated/numpy.linspace.html)

  • Experiment with endpoint


scipy.stats.norm

scipy stats norm

Source


Matplotlib

matplotlib

Source