> ## 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.

# Method_chaining

#### Sourcery rule id: `method_chaining`

#### Description

Chaining methods improves readability


#### Before

```python
df = df.drop_duplicates()
df = df.reset_index(drop=True)
```

#### After

```python
df = df.drop_duplicates().reset_index(drop=True)
```



#### 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.
