Please I have dataframe with four columns that are [keys, summary, description, and summary_description], so iam dealing with summary_description, trying to apply RegEx and extract the new result in a [New_column], so I have done the looping but Iam not sure what is the problem not working getting error. Please if anyone could help, I would really appreciate it.
import pandas as pd
import re
dataf= pd.read_excel(r'C:\Users\malotaibi\Desktop\Last update\result.xlsx')
dataf
dataf.head(5)
dataf['New_Column'][i] = re.sub('[^A-Za-z0-9]+', ' ', dataf['Summary_Description'][i])
print (dataf['New_column'][i])
Error:
KeyError: 'New_Column'
print(dataf.columns), it'll show you the columns you have access to. It says there is no columnNew_Columnwith a capital C. Check it again.