KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to get the count of dataframe rows based on conditional selection. I tried the following code. print df[(df.IP == head.idxmax()) & (df.Method == 'HEAD') & (df.Referrer == '"-"')].count() output: IP 57 Time 57 Method 57 Resource 57 Status 57 Bytes 57 Referrer 57 Agent 57 dtype: int64 The output shows the count for each an every column in the dataframe. Instead I need to get a single count where all of the above conditions satisfied? How to do this? If you need more explanation about my dataframe please let me know.
Tags (comma-separated)
Save Edits
Cancel