Df.mask() VS assignment

Hi all

I have two questions:

  1. How Dataframe.mask() is different from a simple assignment e.g. mvc[v_col][v_mask] = ‘Unspecified’? What are the benefits.
  2. if someone could explain the difference in this example
    df = pd.DataFrame([ [1, np.nan], [2, 3] ], columns=[‘a’,‘b’])

    this will work

    df[‘b’][df[‘b’].isnull()] = ‘unspec’

    This won’t


Seems like first getting series for column and then assign - works, but wise a versa not