0% found this document useful (0 votes)
11 views3 pages

Data Analysis and Visualization Tool

The document is a Python script that implements a menu-driven program for data analysis and visualization using a CSV file. It allows users to display a dataframe, perform data analysis to find items with maximum sales or costs, and visualize data through line and bar graphs. The program utilizes the pandas and matplotlib libraries for data manipulation and plotting.

Uploaded by

gouri.mukhedkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
11 views3 pages

Data Analysis and Visualization Tool

The document is a Python script that implements a menu-driven program for data analysis and visualization using a CSV file. It allows users to display a dataframe, perform data analysis to find items with maximum sales or costs, and visualize data through line and bar graphs. The program utilizes the pandas and matplotlib libraries for data manipulation and plotting.

Uploaded by

gouri.mukhedkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.

import pandas as pd

import [Link] as plt


a=pd.read_csv("C:/Users/Student/Documents/[Link]")
def mainmenu():
print("--------------------------------------------------")
print(" IP PROJECT ")
print("--------------------------------------------------")
print("1. Display Dataframe ")
print("2. Data Analysis")
print("3. Visualize The Data ")
print("4. Exit")
ch=int(input("enter your choice between 1 and 4: "))
while ch>=1 and ch<=4:
if ch==1:
DF()
elif ch==2:
DA()
elif ch==3:
graphs()
elif ch==4:
print("")
print("Thank you.")
break
mainmenu()
else:
print("Wrong input")
mainmenu()
def DF():
print(a)
print("")
print("Thank you.")
mainmenu()
def DA():
print("---------------------------------------------------")
print(" DATA ANAYLSYSIS MENU ")
print("---------------------------------------------------")
print("1. Item with maximum sale")
print("2. Item with highest cost")
print("3. Item with lowest cost")
print("4. Item that brought in the most money.")
print("5. Back to mainmenu")
cho=int(input("enter the choice between 1 and 4: "))
while cho>=1 and cho<=3:
if cho==1:
print("The item that had the highest number sold is:")
print(a[["COUNTRY","PENETRATION"]]
[(a["PENETRATION"]==a["PENETRATION"].max())])
print("thank you.")
break
elif cho==2:
print("the country with maximum average screen time is")
print(a[["COUNTRY","SCREENTIME"]]
[(a["SCREENTIME"]==a["SCREENTIME"].max())])
print("thank you")
break
elif cho==3:
print("")
break
elif cho==4:
print("")
break
elif cho==5:
print("")
print("Going back to mainmenu...")
break
else:
mainmenu()
break
else:
mainmenu()
def graphs():
print("---------------------------------------------")
print(" DATA VISUALISATION MENU ")
print("---------------------------------------------")
print("1.
print("2. bar graph for penetration in each couuntry")
print("3. line graph for screen time of each country")
ch2=int(input("please enter your choice: "))
while ch2>=1 and ch2<=3:
if ch2==1:
line1()
break
elif ch2==2:
bar1()
break
elif ch2==3:
line2()
break

else:
print("please enter valid input")
graphs()
def line1():

[Link]([Link],[Link],marker="*",markersize=10,linestyle="--",linewidth=
3)
[Link]("COUNTRY v/s PENETRATION")
[Link]("COUNTIRES")
[Link]("PENETRATION")
[Link](rotation=30)
[Link]()
print("thank you")
def bar1():
[Link](kind="bar")
[Link](rotation=30)
[Link]()
print("thank you")

def line2():

[Link]([Link],[Link],marker="*",markersize=10,linestyle="--",linewidth=3
)
[Link]("COUNTRY v/s SCREEN TIME")
[Link]("COUNTIRES")
[Link]("SCREEN TIME")
[Link](rotation=30)
[Link]()
print("thank you")
def bar2():
[Link](kind="bar")
[Link](rotation=30)
[Link]()
print("thank you")
mainmenu()

You might also like