Member-only story

Creating a best fit line with Gradient descent.

Kristian Roopnarine
6 min readAug 21, 2019

Using my Master’s Thesis data to create a calibration curve and plot of the pseudo first order reaction of Gamma HBCD.

I have the tools at my disposal to create a best fit line with NumPy and Matplotlib. I’m going to recreate the figures used in my thesis paper. Instead of using the first experiment, I’ll load the second experiment’s data, create the standard calibration curve. Then I’ll create a trend line with the calibration data and use the trend line to extrapolate the concentrations of the unknowns and plot them.

Calibration Curve

The data from the excel file is loaded so let’s take a look at it:

Those NaN cells are weird so I’ll remove them with .dropna() method. To shorten this post I won’t show my ENTIRE process, only the main chunks. Eventually this leads me to this dataframe:

I separated the raw data into two dataframes, one containing the standard concentrations and the other containing the experimental…

--

--

Kristian Roopnarine
Kristian Roopnarine

Written by Kristian Roopnarine

Full Stack Engineer sharing tips and tricks for anyone learning to program. Connect with me on LinkedIn : https://www.linkedin.com/in/kristianroopnarine/

No responses yet