I created a data frame using the following line:
df = pd.read_csv('/Users/cs213/Desktop/class1.csv', sep = ',', error_bad_lines=False)
and if print the columns as such
print (df.columns)
I get
Index(['Text', 'label'], dtype='object')
But if I wanted to use the columns as in here
df = df[df.Text.apply(lambda x: x.isnumeric())]
df = df[df.Text.apply(lambda x: x !="")]
df = df[df.label.apply(lambda x: x !="")]
I get the following error:
AttributeError: 'DataFrame' object has no attribute 'label'
I have already tried the solution in here: Data-frame Object has no Attribute and it did not work.
Sample of the CSV file