I am able to hide data of column NAME by some value of XXXX for which i want to hide the other two column like the NAME column data have some values of XXXX for which i want to hide the data of Address and Number
data = [['NISAMANEE ROWELL', '9198762345','qwerpoiuytr','98 Oxford Ave.Elk Grove Village, IL 60007'], ['ALICE BAISDEN', '8756342865','asdfghjklxc', '94 Valley Rd.Miami Gardens, FL 33056'], ['MARC COGNETTI', '9198762345', 'qwerasdfzxcv' , '221 Summer CircleGreer, SC 29650'], ['JOHNS HOPKINS HEALTHCARE', '9654987642','asdfghjkl', '8522 Pendergast AvenueVilla Park, IL 60181'], ['AMANDA PELLETIER', '9654987642','acderfgds', '8522 Pendergast AvenueVilla Park, IL 60181']]
df = pd.DataFrame(data, columns = ['Name', 'Number','Information','Address'])
df
def name(x):
x=x.title() # title the string
res=pos_tag(word_tokenize(x)) #tokenizing
arr_Val=[] # storing each word in this array
#exceptionList=['Healthcare','Lerner'] # exception list .. MUST UPDATE HERE !!!!
exc_list=['Mackesson Inc','Care','Healthcare','Henery Schien','Besse','LLC','CandP','INC','LTD','PHARMACY','PHARMACEUTICAL','HOSPITAL','COMPANY','ELECTRONICS','APP','VOLUNTEERS','SPECIALITIES','APPLIANCE','EXPRESS','MAGAZINE','SUPPLY','ENDOSCOPY','NETWandK','SCHOOL','AT&T','SOLUTIONS','SANITATION','SYSTEMS','COMPOUNDING','CLINIC','UTILITIES','DEPARTMENT','CREATIVE','PIN','employment','consultant','units','label','machine','anesthesia','services','medical','community','plaza','tech','bipolar','brand','commerce','testing','inspection','killer','plus','electric','division','diagnostic','materials','imaging','international','district','chamber','city','products','essentials','life','scissand','leasing','units','health','healthcare','surgical','enterprises','print','radiology','water','screens','telecom','neurology','biologicals','laundry','owners','law','offices','pharm','office','fire','safety','family','instruments','publishing','automation','center','plate','group','mall','diabetes','estate','electronic','fire','coffee','water','café','factandy','society','group','precision','oxygen','pizza','mills','lock','exterminate','fresh','graves','emeregency','care','security','empire','chemical','associate','mind','optics','coland','toolbox','properties','contract','agreement','learning','exchange','plumbing','leica','sales','shoppe','league','institute','thermo','gas','print','shack','manufacturing','colgate','environmental','neuro','state','board','children','journal','phone','USA','paper','urgent','radio','day','admin','level','bag','church','coast','account','financial','candpandation','sales','andthopedics','andtho','control','handler','king','test','filter','nandth','south','east','west','refrige','laband','bank','system','scientific','instrument','capital','pfizer','lab','labanda','alcon','group','vision','care','alarm','endo','stryke','realty','pest','optic','renewal','star','surgery','stuff','notes','tables','ssurgical','plasma','plaster','code','construction','notes','ink','park','power','gear','link','recandds','amazon','sweet','fish','food','sign','farm','concept','guard','county','prod','duplex','dental','safe','tax','shop','american','ameri','wandks','cloud','exam','therapy','optical','insurance','depot','doctands','telephone','distibutands','cable','comcast','image','first','choice','wear','energy','duke','nandthside','transcription','engineers','alarm','deli','universal','shield','cleaning','resources','int','direct','out','steak','americas','bread','panera','design','media','eye','kreme','krispy','verizon','one','procare','access','point','shield','total','display','pepsi','cola','distributand','consulting','cleaners','flags','mutual','comp','premier','pedaitrics','.com','enterprise','café','linen','opthalmic','upholstery','card','business','waste','innovations','architectural','agency','photography','exterminatands','times','global','house','ultrasound','aetna','flandist','scripture','steel','fast','vascular','corp','town','partnership','utility','advanced','disposal','bcbs','village','payments','corporation','benefit','service','court','dept','partnership','height','coporation','national','grid','fedex','xerox','walgreen','united','walmart','pse&g','communication','reliant','cross','cigna','terminix','staffing','office','admin','phone','expert','source','management','cash','plumber','springs','communications','expert','berkshire','staples','highmark','berkshire','of','Network','window','Locum','Delta','Greater','Treasurer','Investment','Elite','Explore','Foundation','Rentals','Rental','Textile','Municipal','Authority','Treat','Development','University','ACCRUENT','ROTO-ROOTER','KPMG','LLP','Fertilizing','Roofing','Central','Collection','UNIT','Aviation','Development','Acquisition','Square','Unlimited','light','bulbs','CO.','Doctors','Exterminators','Public','Utilities','Registration','Attorney']
exceptionList = [x.title() for x in exc_list]
for i in range( len (res)): # looping to store tokenized words into array
if( res[i][0] in exceptionList ):
return x
else:
arr_Val.append(res[i][0])
#print(res)
for i in range( len(res) ): # checking the POS as proper Noun (NNP)
if( res[i][1]=='NNP'):
length=len(res[i][0])
arr_Val[i]=str(length*'X' )
return(' '.join(arr_Val))
df['Name'] = df['Name'].astype(str).apply(name)
I want to hide the rows of two column Address and Number for which the the name column has contain XXXXX the column Address and Number data should also be hided by the XXXXX of any length