From data in a csv file, I try to obtain using Panda, the sum of the rows of a specific column ("Status_Issue") of the csv file that are:
Here is the code I used but unfortunately it doesn't work, can you please help me to correct my error.
def count_pending_TaxRegulatory():
df = pd.read_csv("sortdata.csv", header=1)
count1 = (df["Status_Issue"]=="Pending").sum()
count2 = df["Status_Issue"].isna().sum()
result1 = count1 + count2
sum() function return the sum of the values for the requested axis, so unless "Status_Issue" is only either 1 or 0 (where isna is making things 1 or 0 thus working), it won't work as you wanted. check this out Count number of rows when row contains certain text