In his video, he had a txt file he imported and read, but when I tried to recreate the the txt file it couldnt be read in correctly. Instead, I tried to create a pandas dataframe with the same data and perform the linear regression/predict on it, but then I got the below error.

Found input variables with inconsistent numbers of samples: [1, 16] and something about passing 1d arrays and I need to reshape them.

From documentation LinearRegression.fit() requires an x array with [n_samples,n_features] shape. So that's why you are reshaping your x array before calling fit. Since if you don't you'll have an array with (16,) shape, which does not meet the required [n_samples,n_features] shape, there are no n_features given.

The same requirement goes for the LinearRegression.predict function (and also for consistency), you just simply need to do the same reshaping when calling the predict function.

plt.plot(x,body_reg.predict(x.reshape(-1,1)))

Or alternatively you can just reshape the x array before calling any functions.

And for feature reference, you can easily get the inner numpy array of values by just calling DF['Brain'].values. You don't need to cast it to list -> numpy array. So you can just use this instead of all the conversion: