Skip to main content

IP | CSV PROJECT- PATIENT MAMAGEMENT

 

CSV PROJECT

PATIENT MAMAGEMENT

# -*- coding: utf-8 -*-

"""

Created on Sat Nov 13 20:37:02 2021


@author: Kirti Hora

"""

import pandas as pd

import matplotlib.pyplot as plt

def main():

  while True:

    print("="*60)

    print("enter 1 to ADD PATIENT DETAILS")

    print("enter 2 to DELETE PATIENT DETAIL")

    print("enter 3 to UPDATE PATIENT DETAIL")

    print("enter 4 to SEARCH PATIENT ")

    print("enter 5 to DISPLAY PATIENT DETAILS")

    print("enter 6 to DISPLAY CITY WISE GRAPH")

    print("enter 7 to EXIT....")

    d=int(input("enter choice:"))

    print("="*60)

    if d==1:

        add()     

    elif d==2:

        delete()

    elif d==3:

        update()

    elif d==4:

        search()

    elif d==5:

        display()

    elif d==6:

        gra()

    elif d==7:

        print("*********THANKS FOR USING HOSPITAL/PATIENT MANAGEMENT SYSTEM**********")

        break     

    else: 

        print("Enter correct choice. . .")


def add():

    print("---------------------------------------------------------------------------")

    print("---------------------------------------------------------------------------")

    df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)

    pid=int(input("Enter pid"))

    if len(df.loc[df['pid']==pid])>0:

        print("Duplicate Record")

    else:

        name=input("Enter NAME")

        cla=int(input("Enter AGE"))

        sec=input("Enter GENDER")

        addr=input("Enter ADDRESS")

        dise=input("Enter DISEASE")

        df.loc[pid]=[pid,name,cla,sec,addr,dise]

        df.to_csv("D:\GRADE XII PYTHON/patients.csv",mode="w") 

        print("RECORD ADDED SUCCESSFULLY")

        print("="*60)

        

def update():

    print("---------------------------------------------------------------------------")

    print("---------------------------------------------------------------------------")

    df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)

    pid=int(input("Enter PATIENT ID:"))

    if len(df.loc[df['pid']==pid])>0:

        name=input("Enter name")

        age=input("Enter AGE")

        gen=input("Enter GENDER")

        addr=input("Enter ADDRESS")

        dise=input("Enter DISEASE")

        df.loc[pid]=[pid,name,age,gen,addr,dise]

        df.to_csv("D:\GRADE XII PYTHON/patients.csv",mode="w") 

        print("RECORD ADDED SUCCESSFULLY")

        print("="*60)

    else:

        print("Invalid Patient Id")

        

def display():

    df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)

    print(df)

    print("="*60)

        

def delete(): 

    print("---------------------------------------------------------------------------")

    print("---------------------------------------------------------------------------")

    df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)

    sid=int(input("Enter Pid"))

    if len(df.loc[df['pid']==sid])>0:

        df.drop(sid,inplace=True)

    df.to_csv("D:\GRADE XII PYTHON/test.csv",mode="w")  

    print("Record Deleted")

    print("="*60)


def search():

    print("---------------------------------------------------------------------------")

    print("---------------------------------------------------------------------------")

    df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)

    pid=int(input("Enter Pid"))

    if len(df.loc[df['pid']==pid])>0:

        print(df.loc[pid])

        print("="*60)

    else:

        print("Record not Found")

        print("="*60)

        

def gra():

    df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)

    plt.plot(df['address'],label="CITY WISE GRAPH")

    plt.title("CITY WISE GRAPH")

    plt.xlabel("CITY")

    plt.show()


main()


___________________________________________________________________

PROJECT -II


# -*- coding: utf-8 -*-

"""

Created on Tue Feb  6 22:07:51 2024


@author: Kirti Hora

"""


import pandas as pd


def main():

    while True:

        print("="*60)

        print("WELCOME TO CBSE MARK ANALYSIS PROGRAM")

        print("="*60)

        print("Enter 1 to DISPLAY RECORDS")

        print("Enter 2 to DISPLAY MAX MARKS ACCORDING TO SUB CODE")

        print("Enter 3 to DISPLAY A1 GRADE ACCORDING TO SUB CODE")

        print("Enter 4 to SEARCH STUDENT")

        print("Enter 5 to EXIT")

        d = int(input("Enter choice: "))

        print("="*60)


        if d == 1:

            upload()

        elif d == 2:

            max_marks()

        elif d == 3:

            grade()

        elif d == 4:

            search()

        elif d == 5:

            print("********* THANKS FOR USING CBSE MARK ANALYSIS SYSTEM **********")

            break

        else:

            print("Enter correct choice...")


def upload():

    print("-"*60)

    df = pd.read_csv(r"C:\Users\Kirti Hora\Downloads\try2.csv", index_col=0)

    print(df)


def max_marks():

    print("-"*60)

    df = pd.read_csv(r"C:\Users\Kirti Hora\Downloads\try2.csv", index_col=0)

    code = int(input("Enter Subject Code: "))

    

    sub = df.loc[df['CD'] == code]

    

    if len(sub) > 0:

        highest = sub['MARKS'].iloc[0]

        for i in sub['MARKS']:

            if i > highest:

                highest = i

        print("Maximum Marks in Subject Code", code, "=", highest)

    else:

        print("Subject Code not found")


def grade():

    print("-"*60)

    df = pd.read_csv(r"C:\Users\Kirti Hora\Downloads\try2.csv", index_col=0)

    code = int(input("Enter Subject Code: "))

    

    sub = df.loc[(df['CD'] == code) & (df['GRADE'] == 'A1')]

    

    if len(sub) > 0:

        print("Students with A1 Grade:")

        print(sub)

    else:

        print("No A1 grade found for this subject")


def search():

    print("-"*60)

    df = pd.read_csv(r"C:\Users\Kirti Hora\Downloads\try2.csv", index_col=0)

    roll = int(input("Enter Roll Number: "))

    

    stu = df.loc[df['ROLLNO'] == roll]

    

    if len(stu) > 0:

        print(stu)

        print("="*60)

    else:

        print("Record not Found")

        print("="*60)


main()

Comments

Popular posts from this blog

GRADE XII - Python Connectivity with MySQL

  Python Connectivity with MySQL In real-life applications, the data inputted by the user and processed by the application needs to be saved permanently, so that it can be used for future manipulation. Usually, input and output data is displayed during execution but not stored, as it resides in main memory , which is temporary — i.e., it gets erased once the application is closed. This limitation can be overcome by sending the data to be stored in a database , which is made accessible to the user through a Front-End interface . Key Concepts Database A database is an organized collection of data that is stored and accessed electronically from a computer system. DBMS (Database Management System) A DBMS is software that interacts with end-users, applications, and the database to capture and analyze data. Front-End The Front-End is the user interface of the application, responsible for input/output interaction with the user. Back-End The Back-End refe...

GRADE XI | DESIGN THINKING & INNOVATION (848) | INTRO | CH-1

  DESIGN THINKING &  INNOVATION (848)  INTRODUCTION LINK : INTRODUCTION PPT PPT LINK Notes: Design Thinking and Innovation Grade XI Introduction Section   I. What is Design? (0.1.1) Definitions from Experts: John Maeda: "Design is solution to a problem". Saul Bass: "Design is thinking made visual". Charles Eames:   “Design is a plan for arranging elements in such a way as best to accomplish a particular purpose.” Steve Jobs:  "Design is not just what it looks like and feels like. Design is how it works". Prof. Sudhakar Nadkarni:  "Essentials of design are— purity, precision, details". Design is a way of understanding needs, identifying problems, and creating appropriate and innovative solutions. It is not only about appearance, but also about usefulness and sustainability. Design is explained as something that helps solve problems and make a positive difference. Key ...