1
我有兩個Dataframes。熊貓/ Python - 均衡不同的索引
DF1:
0 1 2
Date
2005-10-01 772.142457 5600.491978 -5522.102692
2005-11-01 445.861074 4866.226303 -4455.554864
2005-12-01 -390.237513 923.679907 379.381452
2006-01-01 -755.725402 673.734737 198.968080
2006-02-01 -755.725402 673.734737 198.968080
DF2:
Value
Date
2005-07-01 -0.07920
2005-08-01 -0.01412
2005-09-01 -0.03646
2005-10-01 0.17432
2005-11-01 -0.05409
2005-12-01 0.04988
2006-01-01 -0.00232
我希望他們有相同的指標,使DF1保持這樣的:
0 1 2
Date
2005-07-01 NaN NaN NaN
2005-08-01 NaN NaN NaN
2005-09-01 NaN NaN NaN
2005-10-01 772.142457 5600.491978 -5522.102692
2005-11-01 445.861074 4866.226303 -4455.554864
2005-12-01 -390.237513 923.679907 379.381452
2006-01-01 -755.725402 673.734737 198.968080
2006-02-01 -755.725402 673.734737 198.968080
而且DF2保持這樣的:
Value
Date
2005-07-01 -0.07920
2005-08-01 -0.01412
2005-09-01 -0.03646
2005-10-01 0.17432
2005-11-01 -0.05409
2005-12-01 0.04988
2006-01-01 -0.00232
2006-02-01 NaN
我一直在尋找了一段時間來完成這件事,但我無法找到任何功能:(
任何人都可以幫助嗎?