one two duplicated and drop_duplicates by default keep the first observed value combination passing take_last=true will return the last onein [ ]data drop_duplicates([' '' ']take_last=trueout[ ] one one two two transforming data using function or mapping for many data setsyou may wish to perform some transformation based on the values in an arrayseriesor column in dataframe consider the following hypothetical data collected about some kinds of meatin [ ]data dataframe({'food'['bacon''pulled pork''bacon''pastrami''corned beef''bacon''pastrami''honey ham''nova lox']'ounces'[ ]}in [ ]data out[ ]food bacon pulled pork bacon pastrami corned beef bacon pastrami honey ham nova lox ounces suppose you wanted to add column indicating the type of animal that each food came from let' write down mapping of each distinct meat type to the kind of animalmeat_to_animal 'bacon''pig''pulled pork''pig''pastrami''cow''corned beef''cow''honey ham''pig''nova lox''salmondata transformation www it-ebooks info