I am using the following code to use function1 to each unique type in the dataframe:
import pandas as pd d = {\'type\': [\'A\',\'A\',\'B\',\'C\'], \'co