How to apply .replace() inside a column in a pandas data frame to clean data I have a pandas data frame where I want to replace all the values that are not numeric in one column for "" 

The error I'm getting in my code is the following:

ValueError: could not convert string to float: '690,276.00'


Since I'm trying to convert all values into float so I can do internal operations with them.

Part of my cleaning data frame code looks like this:

    # Cleaning:              
df_clean = df_read[~(df_read['Ratio of Similarity (Gray)'] &lt;= .2)]
print(df_clean, 'clean 1: Eliminate Ratio of similarity less than 0.2')
df_clean_2 = df_clean.dropna(subset=['buybox_price'])  
print(df_clean_2, 'clean 2: Eliminate Nan Buybox Prices')
df_clean_2 = df_clean_2.replace(",", "").replace('', '').astype({'product_ranking':'float64'})
df_clean_3 = df_clean_2[~(df_clean_2['product_ranking'] &gt;= 5000000)]
print(df_clean_3, 'clean 3: Eliminate Product Ranking + than 5.000.000')
df_clean_4 = df_clean_3[~(df_clean_3['buybox_price'] &lt;= 6)]
print(df_clean_4, 'clean 4: Eliminate Buybox Price less than 6$')
# Save Cleaned File
path_file = os.path.join(BASE_DIR, 'csv/amazon_product_comparator.csv')
df_hc = df_clean_4.to_csv(path_file) 


The error can be found in the line:

df_clean_3 = df_clean_2[~(df_clean_2['product_ranking'] &gt;= 5000000)]
    print(df_clean_3, 'clean 3: Eliminate Product Ranking + than 5.000.000')
EDITED to include a working example. 

I have made an example with string type numeric data. I have also include a poorly formatted string number 1,002,*8320. 

The code below will convert the numbers in the format of digits and digits with commas to floats, and convert all other strings to NaN. I have used a regular expression to replace commas with blanks.

The NaN must be used over "" since the comparison operator will not work on strings 

import pandas as pd
import numpy as np
import re

# example data frame
df2 = pd.DataFrame([['1', '2000000000'],
                    ['2', '1,002,*8320'],
                    ['3', '1,000,000']],
                   columns = ['idx','product_ranking'])
# Remove Commas
df2['product_ranking'] = df2['product_ranking'].map(lambda x: re.sub('[,]*' , '', x))

# Remove Convert strings that are numeric into floats.
df2['product_ranking'] = df2['product_ranking'].map(lambda x: float(x) if x.isnumeric() else np.nan)

#Comparison is working
df2['product_ranking'] &gt; 100000000