Question: Dataframe is like this:

```
ID    Start_dt
1    10/14/2018
1    10/24/2018
2    7/12/2018

```

I want to find the the max date from the current and previous row i.e.

```
df.Start_dt.rolling(window=1).max().shift(1).fillna(datetime.timedelta(0),unit='days')

```

I get the error that ops is not implemented on rolling.

Output like:

```
ID    Start_dt    New_col
1    10/14/2018    NAN
1    10/24/2018   10/24/2018
2    7/12/2018    10/24/2018

```

Answer: 
IIUC, you can use [`Series.rolling.max`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.window.Rolling.max.html):

```
dts = pd.to_datetime(df['Start_dt'], errors='coerce')
df['New_col'] = (
    pd.to_datetime(dts.astype(int).rolling(2).max()).dt.strftime('%m/%d/%Y'))

   ID    Start_dt     New_col
0   1  10/14/2018         NaT
1   1  10/24/2018  10/24/2018
2   2   7/12/2018  10/24/2018

```
```
df['Start_dt']=pd.to_datetime(df['Start_dt'])
m=df['Start_dt'] > df['Start_dt'].shift()
df['new_col']=np.where(m,df['Start_dt'],df['Start_dt'].shift())

print(df)

#   ID  Start_dt    new_col
#0  1   2018-10-14  NaT
#1  1   2018-10-24  2018-10-24
#2  2   2018-07-12  2018-10-24

```