2891. Method Chaining

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2891

import pandas as pd


def findHeavyAnimals(animals: pd.DataFrame) -> pd.DataFrame:
    return animals[animals['weight'] > 100].sort_values('weight', ascending=False)[
        ['name']
    ]