가능한 중복은 :
Change the index number of a dataframe재정의 행 번호 (인덱스)
나는 dataframe으로 다양한 작업을했고, 행의 수를 제외. 예제에서 알 수 있듯이 이제 데이터 프레임은 366부터 시작합니다. 이 행 번호를 1로 다시 정의하고 물론 다음 색인 번호를 다시 정의하고자합니다.
-> head(new_pred)
pred_mean_temp pred_precipitation pred_visibility pred_wind
366 -0.4707149 156.00677 260.24943 12.006212
367 3.3950894 85.07009 28.66573 12.618096
368 0.9394914 276.67157 12.39165 8.249188
369 -2.9786171 147.03749 10.21351 7.432625
370 -3.5502385 24.66432 16.59086 13.495728
371 -4.2262573 37.21946 17.51434 9.309708
그래서 다음과 같이 표시됩니다
-> head(new_pred)
pred_mean_temp pred_precipitation pred_visibility pred_wind
1 -0.4707149 156.00677 260.24943 12.006212
2 3.3950894 85.07009 28.66573 12.618096
etc.
최고의 감사합니다!
dimnames(new_pred)[[1]]<-seq_len(nrow(new_pred))