I have a Pandas dataframe df with extraneous information. The extraneous information is stored in the columnns that have names containing "PM". I would like to remove these columns but I'm not sure how to. Below is my attempt to do this. However, I received this error message: AttributeError: 'numpy.float64' object has no attribute 'PM'. I'm not sure how to interpret this error message. I also don't understand why numpy is mentioned in the message since the dataframe df is a pandas object.
for j in range(0,len(df.columns)-1):
df.iloc[0,j].str.contains("PM"):
df.drop(j, axis=1)
AttributeError: 'numpy.float64' object has no attribute 'PM'
