0% found this document useful (0 votes)
30 views4 pages

Class 12 INFORMATICS PRACTICES HH.W

The document contains holiday homework for Class XII Informatics Practices at Future Campus School, Sonarpur, focusing on the Pandas library. It includes multiple-choice questions (MCQs) and programming tasks related to creating and manipulating Pandas Series. The tasks cover various functionalities such as indexing, slicing, statistical methods, and handling null values.

Uploaded by

mandalrupam2008
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)
30 views4 pages

Class 12 INFORMATICS PRACTICES HH.W

The document contains holiday homework for Class XII Informatics Practices at Future Campus School, Sonarpur, focusing on the Pandas library. It includes multiple-choice questions (MCQs) and programming tasks related to creating and manipulating Pandas Series. The tasks cover various functionalities such as indexing, slicing, statistical methods, and handling null values.

Uploaded by

mandalrupam2008
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/ 4

FUTURE CAMPUS SCHOOL, SONARPUR

CLASS – XII
SUBJECT: INFORMATICS PRACTICES
CHAPTER: Pandas-I
HOLIDAY HOMEWORK
___________________________________________________________________________________

Group-A

MCQs on Pandas-I:
Give the proper answer for the following mcq questions:

1. Which of the following is the correct way to import the pandas library?
a) import panda
b) import pandas as pd
c) import pd as pandas
d) import Pandas
2. Pandas is built on top of which library?
a) Matplotlib
b) NumPy
c) Seaborn
d) SciPy
3. Which of the following data structures are provided by Pandas?
a) List and Tuple
b) Series and DataFrame
c) Array and Matrix
d) Dictionary and Set
4. What does a Series in Pandas represent?
a) A one-dimensional labeled array
b) A two-dimensional array
c) A collection of tuples
d) A database table
5. Which of the following is the correct way to create a Series from a list mylist?
a) pd.Series(mylist)
b) pd.DataFrame(mylist)
c) pd.series(mylist)
d) pd.list(mylist)
6. By default, what type of index is assigned to a Pandas Series?
a) Character index
b) Date index
c) Integer index
d) Float index
7. Which attribute is used to get the values of a Series?
a) series.index
b) series.labels
c) series.values
d) series.data
8. How do you access the index of a Series?
a) series.index()
b) series.idx()
c) series.indices
d) series.index
9. A Series can be created using:
a) List
b) Dictionary
c) Numpy array
d) All of the above
10. What is the output type of type(pd.Series([1, 2, 3]))?
a) list
b) numpy.ndarray
c) pandas.Series
d) pandas.DataFrame

11. To assign custom indices to a Series, we use the parameter:


a) label
b) columns
c) index
d) row_names
12. Which method is used to convert a dictionary to a Series?
a) Series.dict()
b) pd.Series()
c) dict.Series()
d) series.dict()
13. Which method is used to display the first 5 elements of a Series?
a) series.top(5)
b) series.head()
c) series.first(5)
d) series.begin(5)
14. Which method returns the last n rows of a Series?
a) series.last(n)
b) series.tail(n)
c) series.end(n)
d) series.bottom(n)
15. Which attribute returns the number of elements in a Series?
a) series.length()
b) series.size
c) series.count()
d) series.len
16. What will be the result of series[0]?
a) First column
b) First row value
c) Index label
d) Error
17. What does series[1:4] return?
a) First element
b) Slice of values from index 1 to 4
c) Values at positions 1, 2, 3
d) Error
18. Which method gives basic statistics of a Series?
a) series.stats()
b) series.summary()
c) series.describe()
d) series.analyze()
19. Which of the following functions returns the maximum value of a Series?
a) series.max()
b) series.maximum()
c) max(series)
d) series.high()
20. Which of the following functions returns the sum of all values in a Series?
a) series.sum()
b) sum(series)
c) Both a and b
d) None

21. Which of the following can be used to check for null values in a Series?
a) series.isnull()
b) series.hasnull()
c) series.null()
d) series.empty()
22. Which operator is used for element-wise operations on Series?
a) &
b) *
c) +
d) All of the above
23. The default axis in Series is:
a) 0
b) 1
c) 'index'
d) 'columns'
24. Which of the following returns True if all elements are non-zero?
a) series.nonzero()
b) series.notnull()
c) series.all()
d) series.any()
25. The dtype attribute in Series tells us:
a) Number of rows
b) Data type of the Series
c) Null values
d) Series name

Group-B

Write proper program or code for the following questions:

26. Create a Series and display the value at index 2.


27. Create a Series and print the first 3 elements using slicing.
28. Create a Series and display all elements greater than 50.
29. Create a Series with marks and print the value for the subject "Math" using label indexing.
30. Write a program to retrieve the last two elements of a Series.
31. Create a Series and print:
All values
All indices
Data type
32. Create a Series and print its size and shape.
33. Create a Series of numbers and find its maximum and minimum.
34. Create a Series and calculate the sum and mean of its elements.
35. Create a Series and display the result of series.describe().
36. Create a Series with some np.nan values.
Count the number of null values.
Drop all null values.
Fill null values with 0.
37. Create a Series and check whether it has any null values using isnull() and any().
38. Create a Series with marks and replace all NaN values with the average of the marks.
39. Create two Series and add them element-wise.
40. Create a Series and multiply each value by 10.
41. Create a Series with numeric values and convert them to string type.
42. Create a Series and square each element.
43. Create a Series and display only those elements which are divisible by 3.
44. Create a Series of 10 random integers and filter values greater than the average.
45. Create a Series and count how many values are greater than 50.
46. Create a Series of student marks and sort it in descending order.
47. Create a Series and find the frequency of each unique value using value_counts().
48. Create a Series and rename it using .name attribute.
49. Create a Series and convert it to a list.
50. Create a Series and change its index using the index attribute.

You might also like