0

I currently have the following sample data frame:

No  FlNo    DATE        Loc    
20  1826    6/1/2017    AAA   
20  1112    6/4/2017    BBB   
20  1234    6/6/2017    CCC    
20  43      6/7/2017    DDD    
20  1840    6/8/2017    EEE    

I want to create a new column called "New Date" that is the next row's date value. Please see desired output below:

No  FlNo    DATE        Loc    New Date   
20  1826    6/1/2017    AAA    6/4/2017   
20  1112    6/4/2017    BBB    6/6/2017
20  1234    6/6/2017    CCC    6/7/2017
20  43      6/7/2017    DDD    6/8/2017 
20  1840    6/8/2017    EEE    NaN

After searching stack overflow I'm only able to find code on how to create a new column with the PREVIOUS row's date....not the next row's date.

martineau
  • 112,593
  • 23
  • 157
  • 280
PineNuts0
  • 4,050
  • 16
  • 57
  • 93

0 Answers0