數據集處理好之後,生成新的數據,要把這些數據存儲到Excel文件中,但是我寫不出來。
代碼如下:
Churn_y = np.array(Churn).reshape(-1, 1)
SeniorCitizen_x = np.array(SeniorCitizen).reshape(-1, 1)
Contract_x = Contract_dummies.values
InternetService_x = InternetService_dummies.values
PaymentMethod_x = np.array(PaymentMethod).reshape(-1, 1)
OnlineSecurity_x = np.array(OnlineSecurity).reshape(-1, 1)
OnlineBackup_x = np.array(OnlineBackup).reshape(-1, 1)
DeviceProtection_x = np.array(DeviceProtection).reshape(-1, 1)
TechSupport_x = np.array(TechSupport).reshape(-1, 1)
tenure_x = tenure_dummies.values
MonthlyCharges_x = MonthlyCharges_dummies.values
X = np.concatenate([SeniorCitizen_x, Contract_x, InternetService_x, PaymentMethod_x, OnlineSecurity_x,OnlineBackup_x, DeviceProtection_x, TechSupport_x, tenure_x, MonthlyCharges_x], axis=1)
希望生成兩個xlsx文件