Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas filter with given value

Method 1: Selecting rows of Pandas Dataframe based on particular column value using ‘>’, ‘=’, ‘=’, ‘<=’, ‘!=’ operator.

Example 1: Selecting all the rows from the given Dataframe in which ‘Percentage’ is greater than 75 using [ ].

Python3
# selecting rows based on condition 
rslt_df = dataframe[dataframe['Percentage'] > 70] 
    
print('
Result dataframe :
', rslt_df)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #pandas #filter
ADD COMMENT
Topic
Name
6+1 =