![](/img/trans.png)
[英]Postgresql. How to copy the value of a cell in a row and paste it into another cell of another row in the same table using python
[英](Python) How to Copy and Paste a column to another table?
我不确定它是否能回答您的问题,但请尝试以下代码:
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
我相信有更好的方法来实现。 但是,我通过这个解决了问题
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)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.