I was trying to create a new column to a dataframe such that the new column should have the format as
True/False based on some pattern.
df = pd.DataFrame([[1,16],[21,3],[0.9,56]]) df.columns=['A','B'] df.index = ['1','2','3'] df
I want to create a new column such that if A > 2 and B < 30 will have value as True in a new column, otherwise should have value as False.
I tried to use
np.where to get the new column but I am not sure how can I get values as True or False.