[SOLVED] Data Frame with unique pandas


I have a dataFrame(just a column) which has vehicle brands and its models like, Toyota Rav4, Kia Soul, (brand and models at the same column), I want to show all of Volvo’s models.
Output should be like that,

Volvo xc90
Volvo xc60
Volvo V90

What is the best coding?


Use str.contains('Volvo').

df = pd.DataFrame(['Volvo xc90', 'Volvo xc60', 'Volvo V90', 'abc'])

enter image description here

Answered By – keramat

Answer Checked By – Pedro (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *