python - How to count result rows in pandas dataframe? -
i have pandas dataframe. want count number of rows satisfied condition.
data have 800 rows; data[data['cond'] == 1]
return frame 343 rows. need store number of rows in variable. how can that?
iiuc, think can do:
a = len(data[data['cond'] == 1])
Comments
Post a Comment