Importing packages

In [1]:
import numpy as np
import pandas as pd
pd.options.display.width = 1000

Creating sample dataframe

In [2]:
df = pd.DataFrame(
    {'shop': [101, 101, 101, 102, 102, 102, 103, 103, 103, 103],
     'price': [75, 150, 300, 300, 600, 600, 1000, 1000, np.nan, np.nan]})

Group By

In [3]:
grouped = df.groupby('shop')['price']
print(type(grouped))
<class 'pandas.core.groupby.SeriesGroupBy'>

Checking for Null values in each group

In [4]:
df['has_null'] = grouped.transform(lambda x: pd.isnull(x).any()).astype(bool)
In [5]:
df
Out[5]:
price shop has_null
0 75.0 101 False
1 150.0 101 False
2 300.0 101 False
3 300.0 102 False
4 600.0 102 False
5 600.0 102 False
6 1000.0 103 True
7 1000.0 103 True
8 NaN 103 True
9 NaN 103 True