0% found this document useful (0 votes)
3 views2 pages

Untitled Document

The document provides a Python script that uses the pandas library to create and display a table of diseases along with their associated symptoms. It includes a dictionary with ten diseases and their corresponding symptoms, which is then converted into a DataFrame for display. The output presents a comprehensive overview of the diseases and their symptoms in a structured format.

Uploaded by

Uditanshu Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Untitled Document

The document provides a Python script that uses the pandas library to create and display a table of diseases along with their associated symptoms. It includes a dictionary with ten diseases and their corresponding symptoms, which is then converted into a DataFrame for display. The output presents a comprehensive overview of the diseases and their symptoms in a structured format.

Uploaded by

Uditanshu Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

9.

Creates and displays a comprehensive table of diseases and their associated


symptoms using pandas.

import pandas as pd

# Dictionary of diseases and their symptoms


data = {
'Disease': [
'Common Cold', 'Flu', 'COVID-19', 'Malaria', 'Diabetes',
'Hypertension', 'Asthma', 'Tuberculosis', 'Dengue', 'Typhoid'
],
'Symptoms': [
'Sneezing, Runny nose, Sore throat',
'Fever, Fatigue, Body ache, Cough',
'Fever, Cough, Loss of taste/smell, Breathing issues',
'Fever, Chills, Sweating, Headache',
'Frequent urination, Increased thirst, Fatigue',
'Headache, Dizziness, Chest pain',
'Shortness of breath, Wheezing, Chest tightness',
'Cough, Weight loss, Night sweats, Fever',
'High fever, Headache, Muscle pain, Skin rash',
'Prolonged fever, Abdominal pain, Weakness'
]
}

# Create DataFrame
df = pd.DataFrame(data)

# Display the table


print("Comprehensive Table of Diseases and Their Associated Symptoms:\n")
print(df)

Output
Disease Symptoms

Common Cold Sneezing, Runny nose, Sore throat

Flu Fever, Fatigue, Body ache, Cough

COVID-19 Fever, Cough, Loss of taste/smell, Breathing


issues

Malaria Fever, Chills, Sweating, Headache


Diabetes Frequent urination, Increased thirst, Fatigue

Hypertension Headache, Dizziness, Chest pain

Asthma Shortness of breath, Wheezing, Chest tightness

Tuberculosis Cough, Weight loss, Night sweats, Fever

Dengue High fever, Headache, Muscle pain, Skin rash

Typhoid Prolonged fever, Abdominal pain, Weakness

You might also like