filter() Method

Teradata® Python Package User Guide

brand
Teradata Vantage
prodname
Teradata Python Package
vrm_release
16.20
category
User Guide
featnum
B700-4006-098K

The filter method subsets rows based on the index values of a DataFrame or columns of a DataFrame according to the labels in the specified index.

The filter is applied to the columns of the DataFrame when axis equals 'columns' (or 1). Otherwise, the filter is applied to the values of the DataFrame index when axis equals 'rows' (or 0).

There are three ways to filter using the filter method: item based, substring based and using regular expression. These ways are mutually exclusive in the sense that you must only use one of the following parameters: items, like, or regex.

For the examples in this section, assume DataFrame module is imported, and a DataFrame "df" is created using the commands:

from teradataml import DataFrame
 
df = DataFrame('iris', index_label = ['Name'])