0% found this document useful (0 votes)
8 views2 pages

ADS Mid Term Lab QB

The document consists of a series of important questions related to Python programming, focusing on data handling, manipulation, and visualization techniques. Topics include handling missing values, reshaping arrays, creating series, implementing functions, and performing mathematical operations. Additionally, it covers file reading, web scraping, and data filtering using various Python libraries and methods.

Uploaded by

prakashas404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

ADS Mid Term Lab QB

The document consists of a series of important questions related to Python programming, focusing on data handling, manipulation, and visualization techniques. Topics include handling missing values, reshaping arrays, creating series, implementing functions, and performing mathematical operations. Additionally, it covers file reading, web scraping, and data filtering using various Python libraries and methods.

Uploaded by

prakashas404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab important questions

1. Write a python program to explain how can you handle missing values using simpleimputer.

2. Illustrate reshaping a 3*4 numpy array to 2*2*3 numpy array (using python). State the condition to re-
shape arrays from one array to another.

3. Create an empty series, series using numpy array, series using a list (using python).

4. Explain how can you handle missing values for time series data using python.

5. Explain imputation using K-nearest neighbour with program.(using python)

6. Demonstrate distribution measures on a sample data frame. (Using python).

7. Demonstrate how can you visualise null values using heat map. (Use python).

8. Explain how to implement a simple calculator using functions.

9. Explain how to read different files (excel, table, csv) using pandas in python.

10. Create a 2-D numpy array and perform any five math operations with that array(using python).

11. Implement web scraping in python using BeautifulSoup library(assume datasets).

12. Write a python program to read n integers from the user as a tuple. Create a tuple of tuples with each in-
put item and its count. Sample Input : (1,2,1,3,4,2,4) Output : ((1,2), (2,2), (3,1), (4,2))

13. Explain how can you handle missing values for time series data using python.

14. Explain imputation using K nearest neighbour with program.(using python)

15. Explain imputation using linear regression (using python).

16. Explain any five methods where feature aggregation. (Use python).

17. Explain how to swap first and last elements of a list (using python).

18. Create a 2-D numpy array and perform any five math operations with that array(using python).

19. Write a python program to check whether a number is odd or even using list comprehension.

20. Explain how can you filter data from a data frame using a boolean mask. (Using python)

21. Explain how can you handle missing values using mean , median and mode. (Using python)

22. Read the ages of people in a village. For ages between 1 to 5 store the string "infant", between 6 to 13
store the string "child", between 14 to 18 store the string "teen", between 19 to 35 store the string "young",
between 36 to 60 store the string "adult" and above 60, store the string "senior citizen". Print the resultant
list.

23. Read the marks of 5 students in a course as a tuple. Print the highest, lowest and average of the input.

24. Read n integers from the user as a tuple. Create a tuple of tuples with each input item and its count.

Sample Input : (1,2,1,3,4,2,4) Output : ((1,2), (2,2), (3,1), (4,2))


25. Read student names of two classes using a list of tuples, one tuple for each class. Within each class, as-
sume there are multiple students with the same name. Program should then remove such duplicates in each
class. * Sample Input : [('John', 'Jashwant', 'John'), ('Joel', 'Rahul', 'Joel', 'Boomika')]

Output : [('John','Jashwant'), ('Joel', 'Rahul', 'Boomika')]

26. Create a shopping list with details of fruits purchased as a list of tuples. Each tuple should be(fruit_name,
fruit_weight). Print the following outputs:

a) Print the list in alphabetical order of fruit names.

b) Print the list in ascending order of fruit weights.


c) Print the list in descending order of fruit weights.
Sample Input : [('Grapes', 5), ('Apple', 3), ('Orange', 4)]
Output 1 : [('Apple', 3), ('Grapes', 5), ('Orange', 4)]
Output 2 : [('Apple',3), ('Orange', 4), ('Grapes', 5)]
Output 3: [('Grapes', 5), ('Orange', 4), ('Apple', 3)]
27. Using list Comprehension print the squares of only the positive numbers in a given list [-1, 1,2,-2, -3, 3, -
4, 4]
28. Using List Comprehension, print the squares of the numbers from 1 to 10

You might also like