Apr-27-2019, 08:30 AM
Guys Kindly help identify this error.
# clean tweets def remove_pattern(input_txt, pattern): r = re.findall(pattern, input_txt) for i in r: input_txt = re.sub(i, '', input_txt) return input_txt def clean_tweets(lst): # remove twitter Return handles (RT @xxx:) lst = np.vectorize(remove_pattern)(lst, "RT @[\w]*:") # remove twitter handles (@xxx) lst = np.vectorize(remove_pattern)(lst, "@[\w]*") # remove URL links (httpxxx) lst = np.vectorize(remove_pattern)(lst, "https?://[A-Za-z0-9./]*") # remove special characters, numbers, punctuations (except for #) lst = np.core.defchararray.replace(lst, "[^a-zA-Z#]", " ") return lst --------------------------------------------------------------------------- NameError Traceback (most recent call last) cell_name in async-def-wrapper() NameError: name 'lst' is not defined