Imon Practical Info
Imon Practical Info
PRACTICAL FILE
Informatics Practices
Submitted To Submitted By
Manoj Kumar Nama Name: Cdt. Imon Ghosh
Roll No: 3271/S
Index
List of Experiments
EXPERIMENT NO.1:
Given an ndarray p as ([1, 2, 3, 4]). Write code to plot a bar chart having bars for p
and p**2 (with red colour) and another bar for p and p*2 (with blue colour).
ANS 1.
OUTPUT:
EXPERIMENT NO. 2:
Shubham, a Data Analyst with a multinational brand has designed the DataFrame
df that contains the four quarters' sales data of different stores as shown below :
ANS 2.
(i)
OUTPUT :
(ii)
OUTPUT :
(iii)
OUTPUT :
(iv)
OUTPUT:
EXPERIMENT NO. 2:
Create an array, A, in the range 1 to 20 with values 1.25 apart. Another array,
B, contains the log values of the elements in the array A.
Write a program to create a scatter plot of first vs. second array (array A vs. B)
with red circle markers; specify the x-axis (containing first array’s values) title
as ‘Random Values’ and y-axis title as ‘Logarithm Values’.
ANS 3.
OUTPUT:
Experiment No. 4:
Write a program to iterate over a dataframe containing names and marks which
then calculates grades as per marks(as per guiding below) and adds them to the
grade column.
Marks>= 95 grade A+ ; Marks 50-60 grade C;
Marks 70-90 grade A ; Marks 40-50 grade D;
Marks 60-70 grade B ; Marks <40 grade F
ANS 4.
OUTPUT:
Experiment No. 5:
Given a series nfib that contains reversed Fibonacci numbers with Fibonacci
numbers as shown below:
[0, -1, -1, -2, -3, -5, -8, -13, -21, -34, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
Write a program to plot nfib with following specifications:
(a) The line color should be magenta.
(b) The marker edge color should be black with size 5.
(c) Grid should be displayed.
ANS 5.
Experiment No. 6:
Write a program to create three different Series objects from the three rows of a
DataFrame df.
ANS 6.
OUTPUT:
Experiment No. 7:
Experiment No. 8:
PQR is a list having three lists inside it. It contains summarized data of three
different trials conducted by company A. create a bar chart that plots these three
sublists of ABC in a single chart. Keep the width of each bar as 0.25.
XYZ = [[5, 25, 45, 20], [4, 23, 49, 17], [6, 22, 47, 19]]
Experiment No. 9:
ANS 8.
OUTPUT:
Experiment No. 10:
Write a python program to draw line charts from the given financial data of
XYZ Co. for 5 days in the form a DataFrame namely fdf as shown below:
ANS 10.
OUTPUT:
ANS 11.
OUTPUT:
Ans 12.
OUTPUT:
Experiment No. 13:
ANS 13.
OUTPUT:
OUTPUT:
Experiment No. 15:
ANS 15.
OUTPUT:
Experiment No. 16:
ANS 16.
OUTPUT:
Experiment No. 17:
ANS 17.
(i)
OUTPUT:
(ii)
OUTPUT:
(iii)
OUTPUT:
(iv)
(v)
OUTPUT:
Experiment No. 18:
Write Python code to create a Series object Temp2 storing temperatures of seven
days of week. Its indexes should be 'Sunday', 'Monday',... 'Saturday'.
ANS 18.
OUTPUT:
ANS 19.
OUTPUT:
Apply the Referential Integrity Constraint(ON DELETE CASCADE & ON DELETE SET
NULL) between above table, and answer the following queries.
When we delete civil department from Department Table then what will be the
effect on both tables.
ANS 20.
In this case, when we delete the 'civil' department (where DeptID is 'D101') from
the DEPARTMENT table, the EMPLOYEE table will be affected as follows:
The row where EID is 'E202' and DID is 'D101' (Ravi) will be deleted.
The row where EID is 'E203' and DID is 'D101' (Krishnan) will also be de-
leted.
CASE II: ON DELETE SET NULL
In this case, when we delete the 'civil' department (where DeptID is 'D101') from
the DEPARTMENT table, the EMPLOYEE table will be affected as follows:
The row where EID is 'E202' and DID is 'D101' (Ravi) will have its DID
value changed to NULL.
The row where EID is 'E203' and DID is 'D101' (Krishnan) will also have its
DID value changed to NULL.
ANS 21.
OUTPUT:
Experiment No. 22:
Consider the following tables CABHUB and CUSTOMER.
ANS 22.
(a)
OUTPUT:
(b)
OUTPUT:
(c)
OUTPUT:
(d)
OUTPUT:
ANS 23.
(a)
OUTPUT:
(b)
OUTPUT:
(c)
OUTPUT:
ANS 24.
ANS 25.
(i)
OUTPUT:
(ii)
OUTPUT:
(iii)
OUTPUT:
a. To display employee ids, names of employees, job ids with corresponding job
titles.
b. To display names of employees, sales and corresponding job titles who have
achieved sales more than 1300000.
c.To display names and corresponding job titles of those employees who have
'SINGH' (anywhere) in their names.
e.Write SQL command to change the JOBID to 104 of the EMPLOYEE with ID as E4
in the table 'EMPLOYEE'.
ANS 26.
(a)
OUTPUT:
(b)
OUTPUT:
(c)
OUTPUT:
(e)
(i)
OUTPUT:
(ii)
OUTPUT:
(iii)
OUTPUT:
ANS 28.
ANS 28.
ANS 31.
OUTPUT:
OUTPUT:
GRAPH:
Project 2:
Covid 19 Data Analysis using CSV & Matplotlib.
Dataset contain at least 500 data points.
GRAPH:
Project 3:
# Importing and exporting data between pandas and CSV file.
# To create and open a data frame using ‘Student_result.csv’ file using Pandas.
# To display row labels, column labels data types of each column and the
dimensions
# To display the shape (number of rows and columns) of the CSV file.
# To display Adm_No, Gender and Percentage from ‘student_result.csv’ file.
# To display the first 5 and last 5 records from ‘student_result.csv’ file.
# To display Student_result file with new column names.
# To modify the Percentage of student below 35 with NaN value in dataframe.