We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17c6bc9 commit b215e71Copy full SHA for b215e71
introduction_pandas/2891_method_chaining.py
@@ -54,5 +54,5 @@
54
import pandas as pd
55
56
def findHeavyAnimals(animals: pd.DataFrame) -> pd.DataFrame:
57
- filtered_animals = animals[animals['weight'] > 100].sort_values('weight', ascending = False)
58
- return filtered_animals[['name']]
+ sorted_animals = animals.sort_values("weight", ascending = False)
+ return sorted_animals[sorted_animals['weight']>100][['name']]
0 commit comments