I am trying to clean a dataset which contain some chinese characters and get rid of those rows which contain chinese characters.
I have first tried replacing chinese characters with a space and then tried to use regex to fill the dataset with only those rows and columns which don't have the spaces and punctuations.
df["reviewer_name"] = df["reviewer_name"].str.replace(r'[^\x00-\x7F]+','')
df['comments'] = df['comments'].str.replace(r'[^\x00-\x7F]+', '')
df = df[df['comments'].str.contains(r'\W+', na=False)]
df
The data is like this -
data -
title_id date Reviewer_name comments258716 2019-04-21 Heap Chuan 新公寓,很干净,还有管理员接待
-Expected- All the rows with chinese character to be gone from dataset