i think this can be solved by filling the missing values first right after loading the data
data['variable'].fillna('No data')
and turn them into categorical
data['variable_q'] = pd.Categorical(data['variable'])