how can i add rank column in dataframe in pandas where all the columns of dataframe datatype in string.to achive the following output group by condition based on col1 & col2. trying to create column RANK(which will work as dnese rank same like sql).
df = pd.DataFrame({
'Col1' : ['A1',"A1","A1","A1","A1","A1","A2","A2","A2","A2","A2","A2","A4","A4","A5","A5","A5"],
'Col2' : ['B1',"B1","B1","B2",'B3',"B4","B1","B1",'B2',"B2","B2","B3","B3","B1","B1","B2","B3"],
'Col3' : ['A101',"A102","A103","A104",'A105',"A106","A107","A108","A109","A110","A111","A112","A113","A114","A115","A116","A117"]
})
df