Download the template and
save as 11_1_3_username.py.
Download the CSV file mild_steel_stress_strain.csv and save locally (same file name) for importing and analyzing the data.
Do not submit your stress-strain plot to Gradescope - the autograder will search your code for your plot.
Reminder
Review and reference the Python Style Guide to create a professionally formatted code file. For example, remember to provide detailed comments throughout your code so anyone can read them and understand what your program does!
Write a Python program that imports data from a CSV file, stores the data in a Pandas
DataFrame for cleaning and analysis, and plots the data in a scatter plot with a clear
plot title, axis titles, and axis labels.
Load data from mild_steel_stress_strain.csv into a Pandas DataFrame called data,
and then display the first 5 rows of data.
Calculate and display the mean, median, standard deviation, minimum, and maximum for
both the stress and strain values in data. Test your program output using the
sample input/output below.
Plot the x (strain) and y-values (stress) using the matplotlib library:
importmatplotlib.pyplotasplt
Format the plot as follows:
Plot title: “Mild Steel Stress-Strain Curve”
x-axis title: ‘Strain’ displayed as a percentage
y-axis title: ‘Stress’ with units of MPa, where Pa is Pascals
x-axis limits: 0% to 45%
y-axis limits: 0 to 500 MPa
Line and data point color: blue
Font size:
Plot title: 14
Axis labels: 12
Axes tick values: 12
Label Padding:
x-label: 10
y-label: 10
title: 15
Grid: on, both axes
Minor tick marks: on
Reference Fig. 11.10 below when creating your plot.
Before submitting your python file, comment all lines with plt.show() for autograding purposes.
Save Deliverables: Ensure all required assignment files are saved and named
exactly as specified in the assignment instructions. If a template file name
contains the word template, replace only that word with your Purdue username.
When a task lists more than one deliverable, such as a workbook and a report,
submit each deliverable to its own matching Gradescope assignment instead of
combining them into one upload.
Navigate to Gradescope: Log in to Gradescope. From your Dashboard, open the
assignment.
Upload your work: Select the Upload submission method. Drag and drop all
required files (or a compressed .zip folder) into Gradescope, and select
Upload.
Confirm Submission: When your upload is successful, you will see a confirmation
message on your screen and receive an automated email receipt.
Add Team Members (if applicable): If this is a team assignment, add all team
members to the submission. Each teammate should confirm they can see the submission
in their own Gradescope account. For help, visit
Gradescope’s documentation on adding team members.
Review Autograder Results: Wait a few minutes for the autograder to evaluate the
relevant files. Scroll down to view any failed test cases. If you need assistance
interpreting the output or errors, ask your teaching team.
Resubmit if Necessary: You can edit your files and select Resubmit as many
times as you need before the assignment deadline. Only your final, active submission
is graded. (Note: If you need to resubmit, you must upload all required files
for the assignment again).