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

Series Revision

Class 12 series revision question information practices pdf most recommend question

Uploaded by

shreyanshi1718
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)
44 views3 pages

Series Revision

Class 12 series revision question information practices pdf most recommend question

Uploaded by

shreyanshi1718
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

REVISION

Series
1. What will be the output of the following program ?
import pandas as pd
x=6
S1=pd.Series(x,index=[1,2,4,6,8,9])
print(S1)
2. An attribute of the series in Pandas to set the index label for
the given object ?
3. A one-dimensional array containing a sequence of values in
Python ?
4. In Python Pandas, head(n) method returns the first n members of the
series. What is the default value of n ?
5. What will be the output of the following code ?
import pandas as pd
myser = pd.Series([0, 0,0])
print(myser)
6. The output of addition of two series will be NaN, if one of the elements or both the
elements have no value(s).(T/F)
7. While performing mathematical operations on a series, by default all missing values are
filled in with 0. (T/F)
8. Pushp, a student of class-XII, has been assigned a code to create a pandas series S1, as
shown below.
a 100
b 200
c 300
d 400
e 500
dtype: int64
The command that will give the following output
b 200
c 300
dtype: int64
9. Consider the series given below
a 100
b 200
c 300
d 400
e 500
dtype: int64
The statement can be used to extract the value with the index 'c'
10. Observe the following code and identify what will be the output?
import pandas as pd
Series1 = pd.Series([10,20,30,40,50])
Series2 = Series1*2
print(Series2)
11. What will be the output of following code?
import pandas as pd
S=pd.Series([1,2], index= ['a','b','c'])
Output: ValueError
12. What will be the minimum number of arguments require to pass in pandas series?
13. During the execution of following code, what will be the response, we get
import pandas as pd
s =pd.Series([1,2,3,4,5],index= ['a','b','c','d','e'])
print(s['f'])
Output: KeyError
14. How many elements will be there in the series named “S1”?
>>> S1 = pd.Series(range(5))
>>> print(S1)
15. When we create a series from dictionary then the keys of dictionary
become __________.
16. Write the output of the following:
>>> S1=pd.Series(14, 7, index = ['a', 'b', 'c'])
>>> print(S1)
17. Write the output of the following:
>>> S1=pd.Series([14, 7, 9] ,index = range(1, 8, 3))
>>> print(S1)
18. Write the output of the following:
import pandas as pd
series2 = pd.Series([“Kavi”, ”Shyam”, ”Ravi”], index=[3,5,1])
print(series2 > “S”)
19. We can access elements in Series by using ________ index and ____________ index.
20. Write a command to print Series ‘S1’ in reverse order.
21. import pandas as pd
S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['A', 'B', 'C', 'D'])
S1['A' : 'C'] = 'ND'
22. How many values will be modified by last statement of given code?
import pandas as pd
S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['A', 'B', 'C', 'D'])
S1[1 : 3] = 'ND'
23. S1.values will return all the values of Series ‘S1’ in the form of _________ .
24. Property/attribute return total number of values in Series ‘S1’.
25. An attributes returns True if there is no value in Series?
26. Write the output of the following code :
import pandas as pd
S1=pd.Series([1,2,3,4])
S2=pd.Series([7,8])
S3=S1+S2
print(S3)
print(S3.size)
27. Write the output of the following:
import pandas as pd
S1=pd.Series([1,2,3,4])
S2=pd.Series([7,8])
print((S1+S2).count())
28. Which method is used to add two series?
29. Which two statements will display the difference of two Series ‘A’ and ‘B’?
30. Write the statement that replace missing values of Series A and Series B by 100 .
31. Mathematical Operations on two Series object is done by matching _________.
32. Write the statement that will display values more than 40 from Series ‘S1’?
33. When an operation is carried out on every value of Series object is called _____
34. Which of the following statement will modify the first three values of Series ‘S1’?
(a) S1[0, 1, 2] = 100 (b) S1[0 : 3] = 100 (c) S1[ : 3] = 100 (d) All of the above
35. We can have duplicate indexes in Series? (T/F)
36. Following two statements will provide the same output. (T/F)
>>>L1 * 2 #L1 is a list
>>>S1 * 2 #S1 is a Series
37. To get the number of elements in a Series object, _____ attribute may be used.
38. To get the number of elements in a Series object, _____ attribute may be used.
39. To get the number of bytes of the Series data, _____ attribute is displayed.
40. To display third element of a Series object S, you will write _____.
(a) S[:3] (b) S[2] (c) S[3] (d) S[:2]
41. To check if the Series object contains NaN values, _____ attribute is used.
42. To display first three elements of a Series object S, you may write _____.
43. To display last three elements of a Series object S, you may write _____.
44. To get the number of elements in a Series object, _____ function may be used.

You might also like