I hava two dataframes:
df1:
c1 c2 c3
1 192 1
3 192 2
4 193 3
5 193 3
7 193 5
9 194 7
df2:
v1
192
193
194
I want to add new column in df2, the result is:
df2:
v1 v2
192 2
193 2
194 1
explanation: v1=193, in df1, there are 3 rows, and the corresponding c3 are 3 \ 3 \ 5 the distinct value are 3 and 5, the count is 2, so the v2 in df2 is 2
Thank you, python version is best.