Pandas Quiz 3

Share with others

Welcome to your Pandas Quiz 3

Q21. Which of the following statement will create an empty series named "S1"?

Q22. How many elements will be there in the series named "S1"?

>>> S1 = pd.Series(range(5))

>>> print(S1)

Q23. When we create a series from dictionary then the keys of dictionary become ________

Q24. Write the output of the following :

>>> S1=pd.Series(14,index=['a','b','c'])
>>> print(S1)

Q25. Write the output of the following:

>>> S1=pd.Series(14,7,index=['a','b','c'])
>>> print(S1)

Q26. Write the output of the following :

>>> S1=pd.Series([14,7,9] ,index=range(1,8,3))
>>> print(S1)

Q27. Which of the following code will generate the following output?

Jan 31
Feb 28
Mar 31
dtype: int64

Q28. Write the output of the following:

import pandas as pd
S1 = pd.Series(data = range(31,2,-6), index=[x for x in "aeiou" ])
print(S1)

Q29. What type of error is returned by following code?

import pandas as pd
S1 = pd.Series(data = (31,2,-6), index=[7,9,3,2])
print(S1)

Q30. Write the output of the following :

import pandas as pd
S1 = pd.Series(data = 2*(31,2,-6))
print(S1)


Share with others

9 thoughts on “Pandas Quiz 3”

  1. Which of the following statement will create an empty series named “S1”?
    –>Here you can use both ways; S1 = pd.Series(None) and S1 = pd.Series().

    Reply

Leave a Reply

error: Content is protected !!