Answers for "dataframe count rows with condition"

5

new dataframe based on certain row conditions

filterinfDataframe = dfObj[(dfObj['Sale'] > 30) & (dfObj['Sale'] < 33) ]
Posted by: Guest on April-04-2020
1

value_counts pandas condition

print(df)
OUTPUT
   A  B  C
0  1  2  3
1  4  5  6
2  7  8  9

subset_df = df[df["A"] < 3]
column_count = subset_df.count()

print(column_count)
OUTPUT
A    1
B    1
C    1
dtype: int64
Posted by: Guest on April-22-2021

Code answers related to "dataframe count rows with condition"

Python Answers by Framework

Browse Popular Code Answers by Language