答案 0 :(得分:0)
我不确定是否能回答您的问题,但是请尝试以下代码:
import pandas as pd
table1 = pd.DataFrame(table1) #Table with the first three columns
table2= pd.Series(table2) #Table with Price Prediction
table1["Price Prediction"] = table2
答案 1 :(得分:0)
我相信有更好的方法可以实现。但是,我以此解决了问题
df_out = Table1.reset_index()
Prediction_df = pd.DataFrame(predictions)
Prediction_df = Prediction_df.rename(columns={'XXX': 'Prediction'})
Prediction_df['prediction'] = Prediction_df.reset_index()['Prediction']
df_out1 = pd.merge(df_out,Prediction_df[['prediction']],how = 'left',left_index = True, right_index = True)