Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

Pandas DataFrame lt() Method

❮ DataFrame Reference


Example

Find which values are less than 7:

import pandas as pd

df = pd.DataFrame([[10, 12, 2], [3, 4, 7]])

print(df.lt(7))
Try it Yourself »

Definition and Usage

The lt() method compare each value in a DataFrame to check if it is less than a specified value, or a value from a specified DataFrame objects, and returns a DataFrame with boolean True/False for each comparison.


Syntax

dataframe.lt(other, axis, level)

Parameters

Parameter Description
other Required. A number, list of numbers, or another object with a data structure that fits with the original DataFrame.
axis Optional, A definition that decides whether to compare by index or columns.
0 or 'index' means compare by index.
1 or 'columns' means compare by columns
level Optional. A number or label that indicates where to compare.

Return Value

A DataFrame object.


❮ DataFrame Reference