# create new features, the count of months from the start of the # series and the square of the count of months. CBE.loc[:, 'Month_Cnt'] = [float(i + 1) for i in range(len(CBE.elec_log))] CBE.loc[:, 'Month_Cnt2'] = [x**2 for x in CBE.Month_Cnt]