QST: ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long long'
### 

- [X] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.

- [X] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).


### Link to question on StackOverflow

https://stackoverflow.com/questions/69202964/i-am-unable-to-replace-a-special-character-with-0-and-then-in-return-replace-tha

### Question about pandas

Hi,

I need to replace '?' value with the mean/median value of my 'Price' column. I tried using fillna() but I am getting the above error. I am sharing the code below:

car.info()

[`**<class` 'pandas.core.frame.DataFrame'>
RangeIndex: 205 entries, 0 to 204
Data columns (total 26 columns):
 #   Column             Non-Null Count  Dtype  
---  ------             --------------  -----  
 0   symboling          205 non-null    int64  
 1   normalized-losses  205 non-null    object 
 2   make               205 non-null    object 
 3   fuel-type          205 non-null    object 
 4   aspiration         205 non-null    object 
 5   num-of-doors       205 non-null    object 
 6   body-style         205 non-null    object 
 7   drive-wheels       205 non-null    object 
 8   engine-location    205 non-null    object 
 9   wheel-base         205 non-null    float64
 10  length             205 non-null    float64
 11  width              205 non-null    float64
 12  height             205 non-null    float64
 13  curb-weight        205 non-null    int64  
 14  engine-type        205 non-null    object 
 15  num-of-cylinders   205 non-null    object 
 16  engine-size        205 non-null    int64  
 17  fuel-system        205 non-null    object 
 18  bore               205 non-null    object 
 19  stroke             205 non-null    object 
 20  compression-ratio  205 non-null    float64
 21  horsepower         205 non-null    object 
 22  peak-rpm           205 non-null    object 
 23  city-mpg           205 non-null    int64  
 24  highway-mpg        205 non-null    int64  
 25  price              205 non-null    object 
dtypes: float64(5), int64(5), object(16)
memory usage: 41.8+ [`[KB]**`]]

car['price'].replace({ "?": np.nan},inplace=True)

car['price'] = car.price.astype(float) # changing object datatype to float

car['price'][:15]

**13495.0
1     16500.0
2     16500.0
3     13950.0
4     17450.0
5     15250.0
6     17710.0
7     18920.0
8     23875.0
9         NaN
10    16430.0
11    16925.0
12    20970.0
13    21105.0
14    24565.0
Name: price, dtype: float64**

med_price = car.groupby(['make','aspiration'])['price'].agg(np.median)

car['price'].fillna(med_price,inplace=True)

car.head(15) # this throws the error mentioned above in the question,.

