What is the neatest way to replace the dataframe of values with np.nan if it falls outside of the lower and upper limit?
Values: A,B,C,D
Limits: lower,upper
df1 = pd.DataFrame(np.random.randint(50,300,size=(100, 4)), columns=list('ABCD')) # Generate Random Dataframe
df2 = pd.DataFrame(np.random.randint(150,180,size=(100, 1)), columns=['lower'])
df3 = pd.DataFrame(np.random.randint(180,200,size=(100, 1)), columns=['upper'])
df = pd.concat([df1,df2,df3], axis=1)
df
