Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A B
- 1 21
- 0 21
- 0 21
- 1 25
- 1 28
- 0 28
- A B
- 1 21
- 0 21
- NAN 21
- 1 25
- 1 28
- 0 28
- df['A'] = np.where((df['A'].isnull()) & (df['B'] ==df['B'].shift()),0,df['A'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement