i have a data frame object as below
Issue Type Status Reporter Issue id
0 Eng Activity Closed snalanag 98908
1 Eng Activity In Progress snalanag 98452
2 Eng Activity Closed snalanag 98425
3 Dev-Defect Closed snalanag 97244
4 Dev-Defect Closed snalanag 96716
5 Eng Activity Closed snalanag 96698
6 Dev-Defect Closed snalanag 96696
Now i want to filter data based on multiple conditions.
Condition will be in dictionary.
Example:{'Issue Type': 'Dev-Defect', 'Status': 'Closed', 'Reporter': 'snalanag'}
Based on the condition, i have to filter the data frame by forming the query dynamically. Please note that i need to filter the data by applying AND
condition .
That means i have to apply the filter for the given data frame with "Issue Type = Dev-Defect","Status = Closed","Reporter = snalanag"
at once.
Something like this but it should be generated dynamically based on the condition dictionary.
print (df[(df["Issue key"] == 'BUG-22212') & (df["Issue id"] == 97244) & (df["Status"] == 'Closed')])