I have the following dataframe of topic document probablity matrix
0 1 2 3 4 ... 77 78 79 80 81
1 0.0 9.941665e-23 0.001141 6.837607e-04 0.010396 ... 0.000071 6.475626e-10 1.641026e-02 2.494897e-08 2.017094e-02
2 1.0 2.735043e-03 0.004329 1.915713e-20 0.000202 ... 0.005399 1.367521e-02 1.816478e-12 1.641023e-02 1.366020e-10
where column 0 with values (0.0, 1.0) represents index for topic 1 and 2 respectively. The dataframe has 81 columns and 2 rows. I want to sum up all columns and get another dataframe. For example for column 1, the output would be sum(0.002735042735040934 + 1.7996105239810978e-15) and for all columns. I used
col_list = list(df)
df = df[col_list].sum(axis=0)
but it is only printing
1 0.0027350427350409341.7996105239810978e-15
2 0.0054700854694576.284676740939513e-13
which is not the output I want to be output. What is the correct way to do it? After sorting each values for all columns in descending order I want to output the topic rank for each document in such format.
id topic-rank
1 1, 0
2 1, 0
3 0, 1
4 0, 1
...
80 0, 1
81 1, 0
What is the appropriate way to do that?