Str.replace method returns an attribute error.
dc_listings['price'].str.replace(',', '')
AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas
Here are the top 5 rows of my price column.
In [122]: dc_listings['price'].head()
Out[122]:
577 185.0
2166 180.0
3631 175.0
71 128.0
1011 115.0
Name: price, dtype: float64
This stack overflow thread recommends to check if my column has NAN values but non of the values in my column are NAN.
In [130]: dc_listings[dc_listings['price'].isnull()]
Out[130]:
host_response_rate host_acceptance_rate ... price cleaning_fee security_deposit
float, so you can't use the string methods on it. Also, since it's a float column, it won't have','in it.