---
Product: Aspose.Cells
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/python/autofilter
---

# AutoFilter

## Overview

`AutoFilter` is a class in Aspose.Cells FOSS for Python.

Represents auto filters in a worksheet.

This class declares 15 methods for AutoFilter objects in Python programs.
Available methods include: `__init__`, `add_filter`, `clear_all_filters`, `clear_column_filter`, `custom_filter`, `filter`, `filter_by_color`, `filter_dynamic`, `filter_top10`, `get_filter_column`, `has_filter`, `remove`, and 3 additional methods.
Public members are accessible to any Python application after installing the Aspose.Cells FOSS for Python package.
Properties: `filter_columns`, `range`, `sort_state`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `range` | - | Read/Write | Gets or sets the filter range. |
| `filter_columns` | - | Read | Gets the collection of filter columns. |
| `sort_state` | - | Read/Write | Gets or sets the sort state settings. |

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__()` | Initializes a new instance of the AutoFilter class. |
| `set_range(start_row, start_col, end_row, end_col)` | Sets the filter range using row and column indices. |
| `filter(col_index, values)` | Applies a filter to a specific column. |
| `add_filter(col_index, value)` | Adds a filter value to a specific column. |
| `custom_filter(col_index, operator, value)` | Applies a custom filter to a specific column. |
| `filter_by_color(col_index, color, cell_color)` | Applies a color filter to a specific column. |
| `filter_top10(col_index, top, percent, val)` | Applies a top 10 filter to a specific column. |
| `filter_dynamic(col_index, filter_type, value)` | Applies a dynamic filter to a specific column. |
| `clear_column_filter(col_index)` | Clears the filter for a specific column. |
| `clear_all_filters()` | Clears all filters. |
| `remove()` | Removes the auto filter from the worksheet. |
| `show_filter_button(col_index, show)` | Shows or hides the filter button for a specific column. |
| `sort(col_index, ascending)` | Sets the sort order for a specific column. |
| `get_filter_column(col_index)` | Gets the filter column for a specific column index. |
| `has_filter(col_index)` | Checks if a specific column has filters applied. |

## See Also

- [Aspose.Cells for Python — Enterprise API Reference](https://reference.aspose.com/cells/python-java/)