You have a big list and the goal is to retrieve this new list below

Today:

```
number   color   brand   size   tiresize
-----------------------------------------
1         blue   d       5      6
2         blue   d       5      6
3         red    b       3      3
4         red    b       3      3
etc....

```

Goal:

```
number   color   brand   size   tiresize
-----------------------------------------
          blue   d       5      6
          red    b       3      3

```

The goal is to retrieve a list that is distincted and you remove the "number".

THis sample is a smal one and in reality the list has about 26 datamember.

I was thinking about distinct() but it takes account to all datamember and I dont want to take account to the column "number"

WHen you retrieve the new list, the request is to use the same class before with the distincted list.

```
public Car
{
    public int number
    public string color
    public string brand
    public string size
    public string tiresize
}

```

Thank you!
['https://Stackoverflow.com/questions/37163656', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/484390/']
I think you can use [`groupby`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html) with [`transform`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.groupby.GroupBy.transform.html):

```
import pandas as pd
import numpy as np

df = pd.DataFrame([[1,1,3],
                   [1,1,9],
                   [1,1,np.nan],
                   [2,2,8],
                   [2,1,4],
                   [2,2,np.nan],
                   [2,2,5]]
                   , columns=list('ABC'))
print df
   A  B    C
0  1  1  3.0
1  1  1  9.0
2  1  1  NaN
3  2  2  8.0
4  2  1  4.0
5  2  2  NaN
6  2  2  5.0

df['C'] = df.groupby(['A', 'B'])['C'].transform(lambda x: x.fillna( x.mean() ))
print df
   A  B    C
0  1  1  3.0
1  1  1  9.0
2  1  1  6.0
3  2  2  8.0
4  2  1  4.0
5  2  2  6.5
6  2  2  5.0

```
```
[df[i].fillna(df[i].mean(),inplace=True) for i in df.columns ]

```

This fills then NAN from column C with 5.8 which is the mean of columns 'C'

```
Output    
    print df  
      A  B    C
    0  1  1  3.0
    1  1  1  9.0
    2  1  1  5.8
    3  2  2  8.0
    4  2  1  4.0
    5  2  2  5.8
    6  2  2  5.0  

```