I want to assign values in my DataFrame to a column based on a condition
My data frame is:
a fecha1 fecha2
1 5/5/2018 11:00:00 25/5/2018 16:00:00
2 25/10/2018 10:00:00 15/5/2018 12:00:00
1 15/4/2018 12:00:00 14/9/2013 12:00:00
3 7/11/2017 19:00:00 30/6/2018 19:00:00
4 3/6/2015 17:00:00 31/4/2013 17:00:00
1 9/12/2012 13:00:00 16/5/2014 11:00:00
It would be that when a=1
, fecha2
has to replace fecha1
remaining
a fecha1 fecha2
1 25/5/2018 16:00:00 25/5/2018 16:00:00
2 25/10/2018 10:00:00 15/5/2018 12:00:00
1 14/9/2013 12:00:00 14/9/2013 12:00:00
3 7/11/2017 19:00:00 30/6/2018 19:00:00
4 3/6/2015 17:00:00 31/4/2013 17:00:00
1 16/5/2014 11:00:00 16/5/2014 11:00:00