Assignment 2 DS EC11 3
Assignment 2 DS EC11 3
1|P a g e s u n i l k h i l a r i @ h o t m a i l . c o m 9 8 5 0 9 7 9 6 5 5
Age = ( 22, 24, 26, 27, 25]
Salary = ( 30000, 38000, 42000, 46000, 35000)
3) Perform element-wise addition on two NumPy arrays.
NGI-1 = ( 10, 20, 30, 40, 50 )
NGI-2 =( 100, 200, 300, 400, 500 )
4) Calculate the cumulative sum of a NumPy array and store the results in a new Pandas DataFrame
Data given (100, 200, 300, 400, 500)
5) Calculate the correlation matrix for a Pandas DataFrame for given data as –
Age = ( 22, 24, 26, 27, 25]
Salary = ( 30000, 38000, 42000, 46000, 35000)
Experience = (2, 5, 1, 8, 4 )
---------------------------------------------------------------------------------------------------------------------------------
Chp.5: Data Visiluziation
matplotlib
1) Write a Python code and plot a pie chart with different colors for different slices by using matplotlib
for below data –
Labels = (a, b, c, d)
Sizes = (15, 30, 45, 10)
Colors = (red, green, blue, orange)
2) Write a Python code and plot a stacked bar chart by using matplotlib for below data –
Labels = (a, b, c, d)
Men = (20, 35, 30, 35)
Women = (25, 32, 34, 20)
Seaborn
1) Write python program and draw scatter plots by using Seaborn for below data
x = ( sun, mon, fri, sat, tue, wed, thu)
y = (5, 6.7, 4, 6, 2, 4.9, 1.8 )
2) Write python program and visualize the data with a line plot by using Seaborn for below data
2|P a g e s u n i l k h i l a r i @ h o t m a i l . c o m 9 8 5 0 9 7 9 6 5 5