0% found this document useful (0 votes)
11 views3 pages

Pandas Series Questions Final Cleaned Renumbered

The document contains a series of questions and answers related to the Pandas library in Python, focusing on the creation and manipulation of Series objects. It covers topics such as data types, attributes, methods, and error handling. The questions are formatted in a multiple-choice style, testing knowledge on various aspects of using Pandas.

Uploaded by

kanishkagupta070
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)
11 views3 pages

Pandas Series Questions Final Cleaned Renumbered

The document contains a series of questions and answers related to the Pandas library in Python, focusing on the creation and manipulation of Series objects. It covers topics such as data types, attributes, methods, and error handling. The questions are formatted in a multiple-choice style, testing knowledge on various aspects of using Pandas.

Uploaded by

kanishkagupta070
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/ 3

Q1.

To create an empty series object, you can use:

a. pd.Series(empty)

b. pd.Series(np.NaN)

c. pd.Series()

d. All of these

Q2. To specify datatype int16 for a series object, you can write:

a. pd.Series(data = array, dtype = int16)

b. pd.Series(data = array, dtype = numpy.int16)

c. pd.Series(data = array, dtype = pandas.int16)

d. All of the above

Q3. To get the number of dimensions of a series object, ................... attribute is displayed.

a. index b. size c. itemsize d. ndim

Q4. To get the size of the datatype of the items in series object, you can display ................... attribute.

a. index b. size c. itemsize d. ndim

Q5. To get the number of elements in a series object, ................... attribute may be used.

a. index b. size c. itemsize d. ndim

Q6. To get the number of bytes of the series data, ................... attribute is displayed.

a. hasnans b. nbytes c. ndim d. dtype

Q7. To check if the series object contains NaN values, ................... attribute is displayed.

a. hasnans b. nbytes c. ndim d. dtype

Q8. To display third element of a series object S, you will write:

a. S[3] b. S[2] c. S[3] d. S[2:]

Q9. To display first three elements of a series object S, you may write:

a. S[:3] b. S[3] c. S[:3rd] d. All of these

Q10. To display last five rows of a series object S, you may write:

a. head() b. tail(5) c. tail() d. Either b. or c.


Q11. Missing data in Pandas object is represented through:

a. null b. none c. misslng d. NaN

Q12. Given a Pandas series called Sequences, the command which will display the first 4 rows is:

a. print(Sequences.head(4))

b. print (Sequences.Head(4))

c. print(Sequences.heads(4))

d. print(Sequences.Heads(4))

Q13. Pandas Series is:

a. 2 Dimensional b. 1 Dimensional c. 3 Dimensional d. Multidimensional

Q14. Pandas is a:

a. Package b. Language c. Library d. Software

Q15. We can analyse the data in Pandas with:

a. Series b. DataFrame c. Both a and b d. None of these

Q16. While accessing the column from the dataframe, we can specify the column name. In case column does not exist,

which type of error will it raise:

a. Key Error b. Syntax Error c. Name Error d. Runtime Error

Q17. What will be the output of the given code?

import pandas as pd

S = pd.Series([1,2,3,4,5], index=['akram','brijesh','charu','deepika','era'])

print(S['charu'])

a. 1 b. 2 c. 3 d. 4

Q18. ____________ is a popular data-science library of Python.

Q19. A __________________ is a Pandas data structure that represents a 1D array like object.

Q20. You can use numpy ____________ for missing data.

Q21. To specify datatype for a series object, __________________ argument is used.

Q22. The __________________ function on series object returns total elements in it including NaNs.
Q23. Assertion (A): To specify datatype for a series object, dtype argument is used.

Reason (R): The len() function on series object returns total elements in it including NaNs.

a. Both A and R are true and R is the correct explanation of A

b. Both A and R are true but R is not the correct explanation of A

c. A is true but R is false

d. A is false but R is true

Q24. Assertion (A): The count() function on series object returns only the count of non-NaN values in it.

Reason (R): Series is value mutable.

a. Both A and R are true and R is the correct explanation of A

b. Both A and R are true but R is not the correct explanation of A

c. A is true but R is false

d. A is false but R is true

Q25. Assertion (A): Series is not size mutable.

Reason (R): DataFrame is size mutable as well as value mutable.

a. Both A and R are true and R is the correct explanation of A

b. Both A and R are true but R is not the correct explanation of A

c. A is true but R is false

d. A is false but R is true

You might also like