Fit a polynomial to data and plot it density_water.dat density_air.dat Step 1: w
ID: 3678985 • Letter: F
Question
Fit a polynomial to data and plot it density_water.dat density_air.dat Step 1: write code to read the density-vs-temperature of both water and air data into two lists/arrays. (hint: for each row, you need to detect if first character is #, if so skip it, otherwise parse the data and save it to lists below). Water_temp=[] water_density=[] Air_temp=[] air_density=[] Step 2 Read the description below to generate a polynomial function that fit the data. Step 3: plot the results of the raw data and the fit polynomial function (hint: after you create the fit function in step 2, for each temperature value in water_temp or air_temp, calculate the value of density values and save to water_density_fit[] and air_density_fit[], and then you can plot them together).
Explanation / Answer
{
"data": [ { "x": [ "80", "70", "59", "50", "40" ], "y": [ "0.967", "0.9867346939", "1.007291667", "1.007291667", "1.017894737" ], "mode": "markers", "name": "Col2", "type": "scatter", "uid": "5f392b" }, { "x": [ "80", "70", "60", "50", "40" ], "y": [ "0.96", "0.9784615385", "0.987961165", "0.9976470588", "1.007524752" ], "mode": "markers", "name": "Col4", "type": "scatter", "uid": "7ff235" },
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.