Pandas DataFrame ge() Method
Example
Find which values are greater than, or equal to 7:
import pandas as pd
df = pd.DataFrame([[10, 12, 2], [3, 4, 7]])
print(df.ge(7))
Try it Yourself »
Definition and Usage
The ge()
method compares each value in a DataFrame
to check if it is greater than, or equal to a specified value, or a value from a specified DataFrame
objects, and returns a DataFrame with boolean True/False for each comparison.
Syntax
dataframe.ge(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.