0% found this document useful (0 votes)
9 views8 pages

Python Code Bank Management

The document is a Python script that provides a menu-driven interface for managing bank data using a CSV file. Users can fetch data, view statistics, display records, manipulate records, search for specific entries, and visualize data through various graph types. The program continues to run until the user chooses to exit.

Uploaded by

abhinab174217g
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)
9 views8 pages

Python Code Bank Management

The document is a Python script that provides a menu-driven interface for managing bank data using a CSV file. Users can fetch data, view statistics, display records, manipulate records, search for specific entries, and visualize data through various graph types. The program continues to run until the user chooses to exit.

Uploaded by

abhinab174217g
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

import pandas as pd

import [Link] as plt

# Reading CSV file (relative path)


bank = pd.read_csv("Bank_Management.csv", index_col=0)

while True:
print("\nMain Menu")
print("1. Fetch Data")
print("2. Dataframe Statistics")
print("3. Display Records")
print("4. Working on Records")
print("5. Search Specific row/column")
print("6. Data Visualization")
print("7. Exit")

ch = int(input("Enter your choice (1-7): "))

if ch == 1:
print("\nBank Data:")
print(bank)
elif ch == 2:
while True:
print("\nDataFrame Statistics Menu")
print("1. Column Names")
print("2. Indexes")
print("3. Shape")
print("4. Data Types")
print("5. Size")
print("6. Exit")

ch2 = int(input("Enter choice (1-6): "))

if ch2 == 1:
print([Link])
elif ch2 == 2:
print([Link])
elif ch2 == 3:
print([Link])
elif ch2 == 4:
print([Link])
elif ch2 == 5:
print([Link])
elif ch2 == 6:
break

elif ch == 3:
while True:
print("\nDisplay Records Menu")
print("1. Top 5 Records")
print("2. Bottom 5 Records")
print("3. Top N Records")
print("4. Bottom N Records")
print("5. Specific Customer Details")
print("6. Exit")

ch3 = int(input("Enter choice (1-6): "))

if ch3 == 1:
print([Link]())
elif ch3 == 2:
print([Link]())
elif ch3 == 3:
n = int(input("Enter N: "))
print([Link](n))
elif ch3 == 4:
n = int(input("Enter N: "))
print([Link](n))
elif ch3 == 5:
name = input("Enter Account Name: ")
print([Link][name])
elif ch3 == 6:
break

elif ch == 4:
while True:
print("\nWorking on Records Menu")
print("1. Insert Record")
print("2. Delete Record")
print("3. Update Record")
print("4. Exit")

ch4 = int(input("Enter choice (1-4): "))

if ch4 == 1:
acc = input("Account Name: ")
sav = int(input("Savings: "))
loan = int(input("Loan: "))
cur = int(input("Current: "))
fd = int(input("Fixed Deposit: "))
[Link][acc] = [sav, loan, cur, fd]
print("Record Inserted Successfully")

elif ch4 == 2:
acc = input("Account Name to Delete: ")
[Link](acc, inplace=True)
print("Record Deleted Successfully")

elif ch4 == 3:
acc = input("Account Name to Update: ")
sav = int(input("Savings: "))
loan = int(input("Loan: "))
cur = int(input("Current: "))
fd = int(input("Fixed Deposit: "))
[Link][acc] = [sav, loan, cur, fd]
print("Record Updated Successfully")

elif ch4 == 4:
break
elif ch == 5:
while True:
print("\nSearch Menu")
print("1. Search by Account Name")
print("2. Search by Column")
print("3. Exit")

ch5 = int(input("Enter choice (1-3): "))

if ch5 == 1:
acc = input("Account Name: ")
print([Link][acc])
elif ch5 == 2:
col = input("Column Name: ")
print(bank[col])
elif ch5 == 3:
break

elif ch == 6:
while True:
print("\nData Visualization Menu")
print("1. Line Graph")
print("2. Vertical Bar Graph")
print("3. Horizontal Bar Graph")
print("4. Exit")

ch6 = int(input("Enter choice (1-4): "))

if ch6 == 1:
n = int(input("Enter N: "))
df = [Link](n)
[Link]([Link], df["Savings"], label="Savings")
[Link]([Link], df["Loan"], label="Loan")
[Link]([Link], df["Current"], label="Current")
[Link]([Link], df["Fixed Deposit"], label="Fixed Deposit")
[Link]()
[Link]()

elif ch6 == 2:
n = int(input("Enter N: "))
[Link](n).plot(kind="bar")
[Link]()
elif ch6 == 3:
n = int(input("Enter N: "))
[Link](n).plot(kind="barh")
[Link]()

elif ch6 == 4:
break

elif ch == 7:
print("Program Exited Successfully")
break

You might also like