Method_chaining
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery rule id: method_chaining
Section titled “Sourcery rule id: method_chaining”Description
Section titled “Description”Chaining methods improves readability
Before
Section titled “Before”df = df.drop_duplicates()df = df.reset_index(drop=True)df = df.drop_duplicates().reset_index(drop=True)Explanation
Section titled “Explanation”Chaining methods together can improve readability and performance in Pandas. Instead of applying methods one after another, try chaining them together to create a single expression.