Mehpreet
Mehpreet
places.
Select SNAME, round (BONUS,0) from SALESMAN;
2) Display name, total salary of all salesman after addition of salary and
bonus and truncate it to 1 decimal places.
Select sname, truncate((SALARY+BONUS),1) from SALESMAN;
3) Display remainder of salary and bonus of Salesman whose SNO
starting with ‘A’
Select MOD(SALARY,BONUS) from SALESMAN where SNO like ’A%’;
1. Display the average price of each type of vehicle having quantity more than
20.
Select Type, avg(price) from vehicle where qty>20 group by Type;
10.Display details of all vehicles in ascending order of type and descending order
of vehicle number.
Select * from vehicle order by type asc,v_no desc;
Practical 3-Write a menu driven program to create a pandas series
from a dictionary, ndarray and list.
Solution:
Output:
Practical 4-Write a menu driven program to print all the elements
that are at, above & below 25th, 50th and 75th percentile.
Solution:
Output:
Practical 5:
Write a program that stores the sales of 5 cars for each month in 12
Series objects. The program should display:
1) Item wise total yearly Sales
2) Maximum Sales of item made in a year 3)
Maximum Sales for individual items 4) Maximum Sales
of item made in a months.
Output:
Practical 6-Write a program to change index of existing series,
perform vector, arithmetic operation on series and use of head (), tail
(), drop () function Solution:
Output:
Practical 7- Write a program to perform selection, indexing and
slicing operation on Series. Solution:
Output:
Practical 8- A menu driven program to create a dataframe using 2D
dictionary, 2D array, Series and another dataframe.
Solution:
Practical 9- Create a data frame for examination result and
1. Display row labels, column labels, data types of each column and
the dimensions.
2. Add and delete of column and row in Dataframe
Solution:
Practical 10- Write a program to iterate over a DataFrame containing
names and marks, then calculates grades as per marks (as per
guideline below) and adds them to the grade column.
Marks > =90 Grade A+
Marks 70 – 90 Grade A
Marks 60 – 70 Grade B
Marks 50 – 60 Grade C
Marks 40 – 50 Grade D
Marks < 40 Grade F Solution:
Practical 11- Write a program to perform select subsets from
DataFrame using loc, iloc, head( ),tail( ) functions. Find
maximum, minimum values and transpose of dataframe.
Solution:
Practical 12-Write a program perform Arithmetic binary operations
(Addition, Subtraction, Multiplication, Division) on dataframe.
Solution:
Output:
Output:
Program 14- Program for creating Series objects from
Dataframe columns and DataFrame rows.
Solution:
Practical 15-Write a program to create a DataFrame for
student details and create a CSV file using this DataFrame
and display contents of CSV file. Solution:
Contents of Student1.csv file
1) Open with excel 2) Open with Notepad
Practical 16- Write a program to read a CSV file and display contents
in different format. Copy the CSV file into other CSV file with different
separator.
Solution:
First create a CSV file Employee.csv
Practical 17-Write a program to draw line chart depicting
the prices of the apps and download of the apps. Solution:
Output:
Output:
Practical 18
Output
Practical 20-Write a program to create different histograms
for the weight measurements for 16 small orders of French
fries (in grams). Solution:
Output: