New to python and I am trying to replicate excel COUNTIFS formula using pandas. COUNTIFS(A:A,A2,B:B,B2,C:C,C2)
The countifs column in above screenshot shows my expected result.
New to python and I am trying to replicate excel COUNTIFS formula using pandas. COUNTIFS(A:A,A2,B:B,B2,C:C,C2)
The countifs column in above screenshot shows my expected result.
We have groupby
+ transform
df['countif']=df.groupby(['Col1','Col2','Col3'])['Col3'].transform('count')