1. Attribute filter_data The properties of meet the conditions (month>5) The data of , The assignment is 0.
df["filter_data"].loc[df["Month"]>5] = 0
2. Filter multiple criteria :
df["filter_data"].loc[(df["Month"]>5) & (df['Month']<12)] = 0
3. Filter equals a value :
df1 = df.loc[df['Month'].isin([1,2,3,4,5,12])]
Reference material :https://blog.csdn.net/qq_42902997/article/details/121668004