Pandas str.replace error

Screen Link:


My Code:
#Cleaning the Non-numeric values
autos['price'] = (autos['price'].str.replace('$', '')
                  .str.replace(',', '').astype(int)
                  )

What I expected to happen:

Remove the non-numeric values

What actually happened:

AttributeError                            Traceback (most recent call last)
<ipython-input-38-36725c993131> in <module>
      1 #Cleaning the Non-numeric values
----> 2 autos['price'] = (autos['price'].str.replace('$', '')
      3                   .str.replace(',', '').astype(int)
      4                   )

D:\Anaconda\lib\site-packages\pandas\core\strings\accessor.py in wrapper(self, *args, **kwargs)
     99                 )
    100                 raise TypeError(msg)
--> 101             return func(self, *args, **kwargs)
    102 
    103         wrapper.__name__ = func_name

D:\Anaconda\lib\site-packages\pandas\core\strings\accessor.py in replace(self, pat, repl, n, case, flags, regex)
   1310                 warnings.warn(msg, FutureWarning, stacklevel=3)
   1311             regex = True
-> 1312         result = self._array._str_replace(
   1313             pat, repl, n=n, case=case, flags=flags, regex=regex
   1314         )

AttributeError: 'PandasArray' object has no attribute '_str_replace'

I’m running the CSV on my local computer since the platform is pretty slow now and I getting that error, the columns has the correct name:

autos.colmns: Index([‘name’, ‘seller’, ‘offer_type’, ‘price’, ‘abtest’, ‘vehicle_type’,
‘registration_year’, ‘gearbox’, ‘power_ps’, ‘model’, ‘odometer’,
‘registration_month’, ‘fuel_type’, ‘brand’, ‘unrepaired_damage’,
‘ad_created’, ‘postal_code’, ‘last_seen’],
dtype=‘object’)

Hi @infinetw,

It seems to be an issue of your pandas version. You can find useful this post on StackOverflow. To upgrade pandas directly from your jupyter notebook, run conda update pandas