Premium problem53. Minesweeper: NaN on Mines

Medium Locked

Given the Minesweeper df (with mine and adjacent columns), set adjacent to NaN for every row that contains a mine. Return the DataFrame.

Input

   x  y  mine  adjacent
0  0  0     0         1
1  0  1     1         2
2  1  0     0         3
3  1  1     1         1

Output

   x  y  mine  adjacent
0  0  0     0       1.0
1  0  1     1       NaN
2  1  0     0       3.0
3  1  1     1       NaN

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)