Index
Pr. No. | Practical’s Name / Description | Page. No. |
1. | Write a program to create a Series object using a dictionary that stores the number of students in each section of class 12 in your class. | |
2. | Write a program to create a Series object using individual vowel characters. | |
3. | Write a program to create a Series object using an ndarray that is created by tiling a list [1,2,3]. Use np.tile() methods. | |
4. | Sequences section and contri1 stores the section names (‘A’, ‘B’, ‘C’, ‘D’) and contribution made by them respectively (6700, 5600, 5000, nil) for a charity. Your school has decided to donate as much contribution as made by each section, i.e. the donation will be doubled. Write code to create a Series object that stores the contribution amount as the values and the section names as the indexes with datatype as float32. | |
5. | Write a program to create a Series object that stores the initial budget allocated (5000.00 each) for the four quarters of the year. | |
6. | Write Python program to Create a DataFrame with the help of dictionary, which contains the information about Marks of Five students of five subjects. Dictionary Contains – [Write commands to create dictionary also] Name Maths Sc SSc Hindi Total Aditya 85 95 80 70 330 Saloni 95 100 100 99 394 Muskan 88 99 99 99 385 Tamanna 99 88 99 98 384 | |
7. | Write python code to create a data frame from a 2D dictionary, Sales which stores the quarter-wise sales as inner dictionary for two years, as shown below : Sales = {‘yr1’ : {‘q1’ : 34000, ‘q2’ : 56000, ‘q3’: 85000}, ‘yr2’ : {‘q1’ : 44000, ‘q2’ : 66000, ‘q3’: 55000} } | |
8. | Write a program to create a DataFrame from a list containing dictionaries of the sales performance of four zonal offices. Zone names should be the row labels. | |
9. | Write a program to create a DataFrame to store weight, age and name of 3 people. Print the DataFrame and its index, columns, axes, dtypes, number of rows, number of non-NaN values in each column, and transpose of data frame. [Attributes of DataFrame] | |
10. | Consider the following DataFrame saleDF:- Target Sales zoneA 56000 58000 zoneB 70000 68000 zoneC 75000 78000 zoneD 60000 61000 Write a program to add a column namely Orders having values 6000, 6700, 6200, and 6000 respectively for the zones A, B, C and D. The program should also add a new row for a for a new zone ZoneE. Add some dummy values in this row. | |
11. | Create a DataFrame cityStat having following information – Population Hospitals Schools Delhi 10927986.0 189.0 7916.0 Mumbai 12691836.0 208.0 8508.0 Kolkata 4631392.0 149.0 7226.0 Chennai 4328063.0 157.0 7617.0 Bangalore 5678097.0 1200.0 1200.0 From the above DataFrame cityStat, create another DataFrame and it must not contain the column ‘Population’ and the row ‘Banglore’ | |
12. | Write a program to read from a CSV file employee.csv and create a dataframe from it, but dataframe should not use file’s column header rather should use own column numbers as 0, 1, 2, …… | |
13. | Write a program to store the allDf DataFrame of previous example in fill alln.csv with separator character ‘|’ | |
14. | The student table of test database of MySQL stores student details as RollNO, Name, Marks, Grade. Write a program to load only rows of this Student table where marks > 70 in a dataframe namely mdf. | |
15. | Naman is doing some research. He has a stored line of Pascal’s triangle numbers as ar2 as show below: – ar2 = [1, 7, 21, 35, 35, 21, 7, 1] He wants to plot the sine (use numpy.sin() ) , cosine (use numpy.cos()) and tangent values (use numpy.tan() ) for the same array ar2.He wants cyan color for sine plot line, red color for cosine plot line, and the black color for tangent plot line.Also, the tangent line should be dashed. | |
16. | Write a program to plot a scatter graph taking two random distributions in X1 and Y1 (both with shape as (250,) having randomly generated integers) and plotted against each other with varying sizes and varying colors. | |
17. | Write a program to plat a bar chart from the marks scored by you and your friends in different subjects. | |
18. | DPS school celebrated volunteering week where each section of class XI dedicated a day for collecting amount for charity being supported by the school. Section A volunteered on Monday, B on Tuesday, C on Wednesday and so on. There are six sections in Class XI. Amounts collected by sections A to F are 8000, 12000, 9800, 11200, 15500, 7300 Draw a bar chart to show the collection of amounts graphically. | |
19. | A survey gathers hegith and weight of 100 participants and recorded the participant’s ages :- ages = [1, 1 , 2 , 3 , 5 , 7 , 8 , 9 , 10 , 10, 11, 13, 13, 15, 16, 17, 18, 19, 20, 21, 21, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 27, 27, 29, 30, 30, 30, 30, 31, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 38, 38, 39, 40, 40, 41, 41, 42, 43, 45, 45, 46, 46, 46, 47, 48, 48, 49, 50, 51, 51, 52, 52, 53, 54, 55, 56, 57, 58, 60, 61, 63, 65, 66, 68, 70, 72, 74, 75, 77, 81, 83, 84, 87, 89, 90, 91] Write a program to plat a histogram from above data with 20 bins. | |
20. | Consider a DataFrame mksdf as shown below: Name Age PreBoardMarks BoardMarks 0 Karan 17 4 25 1 Alex 19 24 94 2 Ani 18 31 57 3 Javed 18 2 62 4 Amrit 17 3 70 Write a program to plot pre-board-marks and board marks from above DataFrame on the same line chart | |
21. | MySQL Queries | |
Write a SQL command to create a Database named ‘School’. Also write the command to Create a student table with the student id, name, and marks as attributes where the student id is the primary key. Add columns ‘Mobile’ and ‘Sex’ in the table student.Add column ‘Address’ in the table student.Change the name of column ‘Sex’ to ‘Gender’Delete a column ‘Address’ from table Student.Insert the details of 10 new students in the above table. Use the select command to get the details of the students with marks more than 80. Change the mobile number of any one student.Display the details of those students which name start with ‘A’Write output : SELECT LENGTH(NAME), SUBSTR(NAME, 3,3) FROM STUDENT;Write output : SELECT COUNT (DISTINCT GENDER) FROM STUDENT;Display a report like ‘Aditya is scored 20 out of 30” for each student. Where Aditya is the name of student and 20 is the marks of Aditya.Find the min, max, sum, and average of the marks in a student marks table. Display the Gender, Minimum marks and Maximum Marks Gender wise.Find the total number of students from student table gender wise using group by. Write a SQL query to order the (student ID, marks) table in descending order of the marks. Delete the details of a student in the above table. Delete the table Student.Delete the Database School. |
Download Practical File