I wrote this code where I imported data from a csv file, excluded the rows in 'area' where the value is zero. Now, I am trying to minimize the residual sum of squares error using the minimize function from scipy. From what I have seen so far is that it has been used to call functions. Is there a way to minimize without calling a function and using the two values I have?
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import minimize
# Call csv file
df = pd.read_csv (r'forestfires.csv')
# Will keep the rows where the area is not equal to zero
df = df[df.area != 0]
# Make a list of columns
columns = ['RH', 'FFMC']
FFMC_1 = df["FFMC"].iloc[0:] #Getting the values from FFMC column
FFMC = np.array(FFMC_1)
RH_1 = df["RH"].iloc[0:] #Getting the values from RH column
RH = np.array(RH_1)
# plt.plot(RH) #Ploting RH in X axis
plt.plot(RH,FFMC,'o', color = 'magenta') #Ploting the y axis
plt.title('Relative Humidity vs Fine Fuel Moisture Code') #Plotting the title
plt.xlabel('Relative Humidity (RH)') #Plotting the x label
plt.ylabel('Fine Fuel Moisture Code (FFMC)') #Plotting the y label
plt.grid() #Plotting grid
plt.show()