print(time.time() - start)
start = time.time()
scale_test_input.groupby(['key']).agg(lambda x: x.value_counts().index[0])
print(time.time() - start)
Group by pandas dataframe and select most common string factor