I try to use the add_constant() function with an array of dataset. At index 59 it works (the column is created) but at index 60 it isn't created. Initially, testmat[59] returns a shape of (24, 54) and testmat[60] a shape of (9, 54). Hereafter is what I get when I run the add_constant function:
In: Xnew = sm.add_constant(testmat[59])
Out:
const TRYSIL_PO TRYSIL_TA
6142 1 985.7 271.65
6143 1 984.9 271.85
In: Xnew = sm.add_constant(testmat[60]):
Out:
TRYSIL_PO TRYSIL_TA
6166 983.6 272.75
6167 983.1 272.85
I already checked other sources but it seems that this one hasn't been addressed. Would you have an explanation ?