Question: A streamlined version of our Lab 2 code might be as follows: import io # i nput and o utput files.
A streamlined version of our Lab code might be as follows:
import io #input and output files.
import pandas as pd #pd holds tables in "dataframes".
import numpy as np #np has mathematical tools
import matplotlib.pyplot as plt #plt has our plotting tools.
from google.colab import files #files allow us to upload our csv files into google Colab.
uploaded files.upload #Get data into google colab's memory
dataframe pdreadcsvioBytesIOuploadednextiteruploaded# Move the data into a dataframe
header"Run :Times #Name of date run you want to analyze
header"Data Set :Times # I don't know which one is correct.
timedatadataframeheaderdropnatonumpy # Move just the time data into an array
subtractiondistance #Remember this needs to be corrected!
periodnpzeroslentimedatasubtractiondistance #Set up an array to hold period data.
for i in rangelenperiod:
perioditimedataisubtractiondistancetimedatai #Fill in the period data by subtracting two values
pltplotperiodcolorb label"Student Calculated period" #We ALWAYS want to see what our data looks like!
#pltplotdataframeheaderreplaceTime'Period'xcolorrlabel"Labquest Calculated period"#We might want to see what the LabQuest provided.
pltlegend
pltylabelthis needs to be filled in
pltxlabelthis needs to be filled in
plttitleAnalysis of nextiteruploaded
pltshow
Which of the following could be added to the code above so we can easily see the average value of the period and the uncertainty of the period?
We will need this code to be able to complete part of lab in a reasonable amount of time... so do some testing with the data from last week to make sure you got out all the bugs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
