Lab 2 Check

From PrattWiki
Jump to navigation Jump to search

This page contains instructions to check whether you have the right files in the right place!

  • In Spyder, open a new file (even if there is currently an empty file in the editor)
  • Select the comments that are automatically generated within it and delete them so you have a totally blank canvas
  • Add the following code:
# %% Import modules
import numpy as np
import matplotlib.pyplot as plt

# %% Load and manipulate the data
# Load data from Cantilever.dat
beam_data = np.loadtxt("Cantilever.dat")
  • Go to "Save As" in the File menu (top of the Spyder window for Windows, top of the screen for macOS); use the file navigator to get into your Box/EGR103F23/Lab02Files folder and save this script there as run_can.py
  • Hit the play button / F5 - this will run your script and should change the working directory to your Lab02Files folder
  • In the top right quarter panel of Spyder, select the "Files" tab. You should now see at least four data files, a tex file, and a .py file. If not, let the TAs know so they can come help!