I am trying to make a function to spot the columns with "100" in the header and replace the values in these columns with NaN depending on multiple criteria. For instance let's say I have a df where I want to replace all numbers that are above 100 or below 0 with NaN values :
import pandas as pd
data = {'first_100': ['25', '1568200', '5'],
'second_column': ['first_value', 'second_value', 'third_value'],
'third_100':['89', '9', '589'],
'fourth_column':['first_value', 'second_value', 'third_value'],
}
df = pd.DataFrame(data)
print (df)

