Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>README</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
</style>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" type="text/javascript"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<h1 id="computational-mechanics-02---analyze-data">Computational Mechanics 02 - Analyze Data</h1>
<h2 id="learning-some-statistics-and-data-processing-skills-in-python">Learning some statistics and data processing skills in Python</h2>
<p>Welcome to Computational Mechanics Module #2 - Analyze Data</p>
<p>There are four modules and one final project. The modules will get us started on our exploration of computational mechanics using Python, listed below each module are the learning objectives.</p>
<ol type="1">
<li><a href="./notebooks/01_Cheers_Stats_Beers.ipynb">01_Cheers_Stats_Beers</a></li>
</ol>
<ul>
<li>Read data from a <code>csv</code> file using <code>pandas</code>.</li>
<li>The concepts of Data Frame and Series in <code>pandas</code>.</li>
<li>Clean null (NaN) values from a Series using <code>pandas</code>.</li>
<li>Convert a <code>panda</code>s Series into a <code>numpy</code> array.</li>
<li>Compute maximum and minimum, and range.</li>
<li>Revise concept of mean value.</li>
<li>Compute the variance and standard deviation.</li>
<li>Use the mean and standard deviation to understand how the data is distributed</li>
<li>Plot frequency distribution diagrams (histograms).</li>
<li>Normal distribution and 3-sigma rule.</li>
</ul>
<ol start="2" type="1">
<li><a href="./notebooks/02_Seeing_Stats.ipynb">02_Seeing_Stats</a></li>
</ol>
<ul>
<li>You should always plot your data.</li>
<li>The concepts of quantitative and categorical data.</li>
<li>Plotting histograms directly on columns of dataframes, using <code>pandas</code>.</li>
<li>Computing variance and standard deviation using NumPy built-in functions.</li>
<li>The concept of median, and how to compute it with NumPy.</li>
<li>Making box plots using <code>pyplot</code>.</li>
<li>Five statistics of a box plot: the quartiles Q1, Q2 (median) and Q3 (and</li>
<li>interquartile range Q3<span class="math inline">\(-\)</span>Q1), upper and lower extremes.</li>
<li>Visualizing categorical data with bar plots.</li>
<li>Visualizing multiple data with scatter plots and bubble charts.</li>
<li><code>pandas</code> is awesome!</li>
</ul>
<ol start="3" type="1">
<li><a href="./notebooks/03_Linear_Regression_with_Real_Data.ipynb">03_Linear_Regression_with_Real_Data</a></li>
</ol>
<ul>
<li>Making our plots more beautiful</li>
<li>Defining and calling custom Python functions</li>
<li>Applying linear regression to data</li>
<li>NumPy built-ins for linear regression</li>
<li>The Earth is warming up!!!</li>
</ul>
<ol start="4" type="1">
<li><a href="./notebooks/04_Stats_and_Montecarlo.ipynb">04_Stats_and_Montecarlo</a></li>
</ol>
<ul>
<li>How to generate “random” numbers in Python+</li>
<li>The definition of a Monte Carlo model</li>
<li>How to calculate <span class="math inline">\(\pi\)</span> with Monte Carlo</li>
<li>How to take the integral of a function with Monte Carlo</li>
<li>How to propagate uncertainty in a model with Monte Carlo</li>
<li><strong>Bonus</strong>: use Sympy to do calculus and algebra for us! _no need for</li>
<li>Wolfram, sorry Stephen_</li>
<li>How to generate a normal distribution using uniformly random numbers</li>
</ul>
<p>+The computer only generates pseudo-random numbers. For further information <strong>and</strong> truly random numbers check <a href="https://www.random.org/randomness/">www.random.org</a></p>
<h2 id="computational-mechanics-project-02---create-specifications-for-a-spitballingrobot"><a href="./project/02_Analyze-data_project.ipynb">Computational Mechanics Project #02 - Create specifications for a spitballingrobot</a></h2>
<p>On the first day of class, we threw <span class="math inline">\(2&quot;\times~2&quot;\)</span> dampened paper (spitballs) at a target on the whiteboard. Now, we are going to analyze the accuracy of the class with some cool Python tools and design a robot that has the same accuracy and precision as the class.</p>
<p>The goal of this project is to determine the precision of necessary components for a robot that can reproduce the class throwing distibution. We have generated pseudo random numbers using <code>numpy.random</code>, but the class target practice is an example of truly random distributions. If we repeated the exercise, there is a vanishingly small probability that we would hit the same points on the target, and there are no deterministic models that could take into account all of the factors that affected each hit on the board.</p>
<p><img src="./images/robot_design.png" style="height: 250px;"/></p>
</body>
</html>