Answer to Question #266270 in Python for sindhu

Question #266270

Write a PYTHON program 

  1. Create a data record in MySQL using patient meta data from <span style="font-size: 12pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; text-decoration-line: underline; vertical-align: baseline;">https://repl.it/@<wbr>GaneshManoharan/<wbr>InstructiveChocolateLint#<wbr>PatientData.csv</span>
  2. Create a JSON and parse it through PHP and show the details in HTML 
  3. Provide a search option to filter the data


Common header of the csv would be


ID, Diagnosis Age,Sex,Ethnicity Category,Histology,Adjuvant Treatment,ECOG Performance Status,Smoking History,Person Cigarette Smoking History Pack Year Value,Relapse Free Status,Relapse Free Status (Months),Ubiquitous Assay Panel,Percent Necrosis,Tumor Volume (cm3),Tumar Stage



JSON format sample


Sample output in HTML

Have a global search to filter any columns/rows.


 

Note: Use BootStrap, JQUERY Data table and CSS to beautify the output.

1
Expert's answer
2021-11-16T00:47:01-0500
import pandas as pd

#df variable where you have to enter the path of the .csv file

df = pd.read_csv(r"C:\Users\umidbek.ulmasov\Downloads\PatientData.csv")




look = 1 # look value

#Here search variable for your filters

matches = df[df['Ubiquitous Assay Panel'] == look] # filter rows




# if, else condition for your search

if len(matches)>0:

  items = matches.drop('Ubiquitous Assay Panel', axis=1).values.tolist() #drop which column you want column

  print(items)

else:

  print("There is no match inside the data")




#This code considered by expert Umedjon

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS