value counts pandas condition

Solutions on MaxInterview for value counts pandas condition by the best coders in the world

showing results for - "value counts pandas condition"
Máximo
13 Jun 2020
1print(df)
2OUTPUT
3   A  B  C
40  1  2  3
51  4  5  6
62  7  8  9
7
8subset_df = df[df["A"] < 3]
9column_count = subset_df.count()
10
11print(column_count)
12OUTPUT
13A    1
14B    1
15C    1
16dtype: int64