I have two columns in a pandas frame.
Column 1 is known and contains rows (e.g. 'a', 'a', 'b,' c ',' c ',' a ')
ed column = ['a','a','b','c','c','a']
Column 2 is a task and also contains rows (for example, "aa", "bb", "aa", "aa", "bb", "cc")
job column = ['aa','bb','aa','aa','bb','cc']
Then I create a table with two columns:
my_counts= pdata.groupby(['ed','job']).size().unstack().fillna(0)
Now, how to divide the frequencies in one column into the frequencies in another column of this frequency table? I want to accept this ratio and use it for argsort() so that I can sort by the calculated coefficient, but I donβt know how to refer to each column of the resulting table.