I have a dataframe of 3 columns. The dataframe example is presented below with the intended final result:
initial data final result
column1 column2 column3 column2 count avg_column3
123 -6.23,101.45 3 --> -6.23,101.45 3 4
335 -6.23,101.45 4 --> -6.12,102.33 2 8
456 -6.23,101.45 5
324 -6.12,102.33 10
232 -6.12,102.33 6
I am trying to count how many unique values in column2 while simultaneously getting the value of column3 and getting the average. I know how to get the unique values using pivot_tables but how do I get the average of column3?