Question: a . Write a Python program ( Q 1 _ code A . py ) to write the above data on to an Excel file,

a. Write a Python program (Q1_code
A.py) to write the above data on to an Excel file, named "Fuel_consumption.xlsx", complete with headers and and indices (model names).
b. In a different Python program (Q1_code_B.py):
i. Read the data from the Excel file you created into the code.
ii. Use a straight-line fit (linear regression) on the whole data, and plot O?(Phi) on y-axis and mass M on x-axis (your figure should have above data points, as well as the fitted line)
iii. Calculate and print the slope of the fitted straight line (using code only, not hand calculations)
c. In yet another Python program (Q1_code_C.py), repeat step (b) separately for Ford and Honda cars, meaning,
i. Take the data for the first 7 vehicles in the table (Ford), work through steps (b)(i-iii) for that data
ii. Do the same for the last 5 vehicles in the table (Honda)
a . Write a Python program ( Q 1 _ code A . py )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!