-1
predictors_5 = combined_data[['Mean Mobility']]
response_5 = combined_data['Reproduction 7-Day Avg']

regression_5 = linear_model.LinearRegression()
model_5 = regression_5.fit(np.log(predictors_5),np.log(response_5))

print('Coefficients: ',model_5.coef_,'Intercept: ',model_5.intercept_,'\nR-Squared: ',model_5.score(predictors_5,response_5))

here is the code, I'm looking to find the log of the combined data like np.log(combined_data[['Mean Mobility']]) but i need to convert it to a numpy array and I tried to_numpy() but that didn't work

help_pls
  • 1
  • 2

1 Answers1

0

Why it didn't work? Sounds weird. What is the error you are getting?

I found this: Convert pandas dataframe to NumPy array

This should be your command:

response_5_arr = response_5.to_numpy()