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.

Jonas
  • 121,568
  • 97
  • 310
  • 388
PineNuts0
  • 4,740
  • 21
  • 67
  • 112

0 Answers0