Вы находитесь на странице: 1из 5

GRADE XII – IP PRACTICAL PROGRAM LIST

NUMPY:
1. Write a program to create an ndarray containing numeric values from 0 to 10.
2. Write a program to create a 4*5 array with values ranges from 5 to 43 each spaced with a
difference of 2.
3. Write a program to create a 3*3 array and extract all odd and even numbers from the array.
4. Write a program to create a 4*4 identity matrix.
5. Write a program to create a 4*3 array and print the array and its transpose.
6. Write a program to create a 2D array having 8 ones and change the 3rd and 6th elements of
this array to 10.
7. Write a program to create the following arrays and perform the following.
3 1 4 2 5 2
A= [1 2 0 3 2] B= [3]
0 3 2 4 6 4
a) Add 10 the array A
b) Add array B to A
c) Multiply 3 by array B
8. Write a NumPy program to append values to the end of an array.
Expected Output: Original array: [10, 20, 30]
After append values to the end of the array: [10 20 30 40 50 60 70 80 90]
9. Write a NumPy program to find the number of elements of an array, length of one array
element in bytes and total bytes consumed by the elements

PYTHON PANDA:
10. Write a Pandas program to add, subtract, multiple and divide two Pandas Series
11. Write a Python program to convert a dictionary to a Pandas series.
Sample Series: Dictionary: {'a': 100, 'b': 200, 'c': 300, 'd': 400, 'e': 800}
Converted series: a 100 b 200 c 300 d 400 e 800 dtype: int64
12. Create a Data Frame where Name, Marks in 3 subjects of 10 students is stored. Use map
functions to find the min, max, mode, mean, count, sum, median of all the data.
13. Write a Pandas program to select the rows where the height is not known, i.e. is NaN.
'name': ['Asha', 'Radha', 'Kamal', 'Divy', 'Anjali'],
'height': [ 5.5, 5, np.nan, 5.9, np.nan],
'age': [11, 23, 22, 33, 22]
14. A dataframe stores data about the passengers, flights and years. The rows of dataframe
are shown below.
Year Month Passengers
0 2009 January 112
1 2009 February 118
2 2009 March 132
3 2009 April 129
4 2009 May 121
Create above dataframe and find the following:
a) Compute total passengers per year.
b) Compute average passengers per month.
15. Write a Pandas program to select the name of persons whose height is between 5 to 5.5
(both values inclusive)
'name': ['Asha', 'Radha', 'Kamal', 'Divy', 'Anjali'],
'height': [ 5.5, 5, np.nan, 5.9, np.nan],
'age': [11, 23, 22, 33, 22]

PLOTTING WITH PYPLOT:


16. The number of students in 7 different classes is given below. Represent this data on the
bar graph.
Class 6th 7th 8th 9th 10th 11th 12th
Number of Students 130 120 135 130 150 80 75
17. From the following ordered set of data:

63, 65, 67, 69, 69, 71, 71, 72, 74, 75, 78, 79, 79, 80, 81, 83

(a) Create a horizontal boxplot


(b) Create a vertical boxplot
18. The table shows passenger car fuel rates in miles per gallon for several years. Make a
LINE GRAPH of the data. During which 2-year period did the fuel rate decrease?
YEAR 2000 2002 2004 2006
RATE 21.0 20.7 21.2 21.6

19. Given the following set of data:


Weight measurements for 16 small orders of French fries (in grams).
78 72 69 81 63 67 65 75
79 74 71 83 71 79 80 69
(a) Create a simple histogram from above data
(b) Create a step type of histogram from above date
20. The Production(in Tone) by Factory in Years is shown below Represent this data on the
scatter graph.
Year 2000 2005 2010 2015
Production in Tons 50 40 30 60

DJANGO:
21. Write a Django program which retrieve user details (rollno, class, name, city, mobile)
from web and writes it in a CSV file.

PYTHON INTERFACE WITH MYSQL:


22. Write a python program to insert new records into Student table in ‘school’ database at
run time and whose structure is given below.
student [rollno int(3), class char(4), name varchar(30), city char(20), mobile char(10)]
23. Write a python program to retrieve and display details of all XIIth class students from
student table. The structure is given below.
student [rollno int(3), class char(4), name varchar(30), city char(20), mobile char(10)]
24. Write a python program to update the mobile number of the student whose rollno is
entered at the runtime.
student [rollno int(3), class char(4), name varchar(30), city char(20), mobile char(10)]
25. Write a python program to delete the record of the student on the basis of the roll number
entered.
student [rollno int(3), class char(4), name varchar(30), city char(20), mobile char(10)]
SQL QUERIES:
26. Consider the tables FLIGHTS & FARES. Write SQL commands for the statements.

i) Display flight number & number of flights from Mumbai from the table flights.
ii) Arrange the contents of the table flights in the descending order of destination.
iii) Increase the tax by 2% for the flights starting from Delhi.
iv) Display total no of source stations (eliminate duplicate) present in the table.
v) Display the fare for the flight for MUMBAI to BANGLORE
vi) Display the records of source stations started with letter ‘B’.
vii) Display the flight no. for which fare to be paid is less than 3000.
viii) Display total no. of flights available for each Airlines
ix) Add a new column Dep_Time in the table Flight.
x) Delete the record of flight no. IC301 from the table FARE.
27. Consider a database LOANS with the following table:
Write SQL commands for the following:-
1. Create the database LOANS.
2. Open the database LOANS.
3. Create the table Loan_Accounts and insert tuples in it.
4. Display the details of all the loans.
5. Display the AccNo and Loan_Amount of all the loans started before 01-04-2009.
8. Display the details of all the loans whose rate of interest is NULL.
9. Display the amounts of various loans from the table Loan_Accounts. A loan amount
should appear only once.
10. Display the details of all the loans started after 31-12-2008 for which the number of
instalments are more than 36.
11. Display the Cust_Name and Loan_Amount for all the loans for which the loan
amount is less than 500000 or int_rate is more than 12.
12. Display the Cust_Name and Loan_Amount for all the loans for which the number of
instalments are 24, 36, or 48. (Using IN operator)
13. Display the details of all the loans whose Loan_Amount is in the range 400000 to
500000. (Using BETWEEN operator)
14. Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the
Cust_Name ends with 'Sharma'.
15. Display the details of all the loans in the descending order of their Start_Date.
16. Put the interest rate 11.50% for all the loans for which interest rate is NULL.
17. Delete the records of all the loans whose start date is before 2007.
18. Add another column Category of type CHAR(1) in the Loan table.

Вам также может понравиться