Given a test dataset as follows:
id city name 0 1 bj NaN 1 2 bj jack 2 3 bj NaN 3 4 bj jim 4 5 sh NaN 5 6 sh NaN