x
是一个大小为[16754,3]的数据集
a
是一个大小为[16754,1]的数组。据我所知,轴心是完全匹配的。
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('data_monthly_rainfall.csv')
x = dataset.iloc[:, [0,1,2]].values
y = dataset.iloc[:, 3].values
# Apending a coloumn y with 1 for the equation
import statsmodels.api as sm
a = np.ones((16754, 0)).astype(int)
x = np.append(arr = a,values = x, axis = 1)