Python: how to get unique ID and remove duplicates from column 1 (ID), and column 3 (Description), Then get the median for column 2 (Value) in Pandas
Well you have e.g. 6 'ID' with value '123456'. If you only want unique 'ID', you need to remove 5 'ID' rows, by doing this you will not have duplicate 'Description' values anymore. The question is, do you want unique ID or unique Description values (or unique combination of both)?
Python: how to get unique ID and remove duplicates from column 1 (ID), and column 3 (Description), Then get the median for column 2




ID
Value
Description




123456
116
xx


123456
117
xx


123456
113
xx


123456
109
xz


123456
108
xz


123456
98
xz


121214
115
abc


121214
110
abc


121214
103
abc


121214
117
abz


121214
120
abz


121214
125
abz


151416
114
zxc


151416
135
zxc


151416
127
zxc


151416
145
zxm


151416
125
zxm


151416
121
zxm




Procced table should look like:




ID
xx
xz
abc
abz
zxc
zxm




123456
110
151
0
0
0
0


121214
0
0
132
113
0
0


151416
0
0
0
0
124
115