In sklearn, in order to train the data using fit method in linear regression, we have to reshape the 1D arrays. But, in the case of linear regression with multiple variables, I got the output without reshaping of the target variable.
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
df = pd.read_csv("Weather.csv",low_memory = False) # the data set I used
df1 = df[["Precip","MaxTemp"]]
reg = LinearRegression().fit(df1.head(),df.MinTemp.head()) # no error with shape of df1 is (5,2) and shape of df.MinTemp.head() is (5,)
Can I know the reason behind this? Thanks in advance.