2017-12-31 64 views

답변

0

당신은 사용할 수 있습니다 resampleffill :

df = pd.DataFrame({'date':pd.date_range('2001-01-01',periods=15, freq='AS'), 
        'Value_1':np.random.randint(0,100,15)}) 

df=df.set_index('date') 

df_out = df.resample('QS').ffill() 

print(df_out.head(10)) 

출력 :이 질문에 좋은 답변을 얻을 수있는 충분한 정보가없는

  Value_1 
date    
2001-01-01  87 
2001-04-01  87 
2001-07-01  87 
2001-10-01  87 
2002-01-01  37 
2002-04-01  37 
2002-07-01  37 
2002-10-01  37 
2003-01-01  11 
2003-04-01  11