0

I am trying to add some values in the data-frame comparing some keys .

Here I have following columns data.

cols = [100,156,160,162,200,256,262,2200,2600,2900,3600,4600,2000]

I am getting the result like,

RFC_MATCHING_COUNT = compare_df[compare_df.RFC_MANUAL==1].MANUAL_PREDICTEDFEATURE.value_counts()

100     1224
160      643
0        607
4600     124
200       60
2200      24
162       16
156       15
3600      14
262       14
256       14
2000      11
2900       2
2600       2

Now I have one final data frame which looks like ,

    Features    Manual_Predicted    Jape_Predicted  RFC_Predicted   
0   100              1837                862            1629
1   156               29                  23              17
2   160              1062                 43             832
3   162               30                  20              18
4   200              215                  65             651
5   256               16                   1              28
6   262              16                   4               31
7   2200            24                   24               24
8   2600            21                    6                 2
9   2900             9                   10                 7
10  3600           172                   151               14
11  4600           143                    191             167
12  2000            11                    7                13

Now I am trying to add the result of the operation into this data-frame using the columns I have in the Features column that I have in the final data frame. So from that previous result only those values should be added in the final dataframe.

My output would be like

Features      Manual_Predicted  Jape_Predicted  RFC_Predicted   final
        100         1837               862          1629      1224
        156          29                23             17
        160          1062               43           832       643
        162           30                 20           18
        200            215               65          651       60
        256            16                 1           28
        262            16                 4           31
        2200          24                  24          24
        2600           21                  6           2
        2900             9                 10          7
        3600           172                151          14
        4600           143                191         167         124
        2000            11                  7          13  

SO Here for example purpose only I have added 4 values only But I want to add all the values RFC_MATCHING_COUNT from these which will match.

its like 100 - 1224 for example 0 which is not in the output column that I won't add .

can any one help me with this ?

ganesh kaspate
  • 1
  • 9
  • 41
  • 88

0 Answers0