NEW
Font size
WorksheetsSeries1
Total questions: 10
Worksheet time: 5mins
What is the default data type of a Series in Pandas?
int64
float64
object
number
Which of the following is/are parameters of Series() function?
index
data
copy
all of above
Predict output of the following code.
import pandas as pd
s=pd.Series([22,33,44,55,66]
print(s.loc[3:4])
44
55
66
Error
Series.head() will return how many rows.
2
3
4
5
Minimum number of argument we require to pass in pandas series ?
0
1
2
3
Full form of NaN is
Not a Null
Not a Number
Not a Numeric
None of these
Write the output for the following:
import pandas as pd1
s = pd1.Series(5, index=[0, 1, 2, 3])
print(s)
0 5
0 5
1 5
2 5
3 5
dtype: int64
1 5
2 5
2 5
4 5
dtype: int64
0 5
1 5
2 5
3 5
dtype: object
write the output:
import pandas as pd1
s = pd1.Series([1,2,3])
t = pd1.Series([1,2,4])
u=s-t
print (u)
0 1
1 0
2 1
dtype: int64
0 0
1 0
2 1
dtype: int64
0 0
1 0
2 -1
dtype: float64
0 0
1 0
2 -1
dtype: int64
write the output:
import pandas as pd
s=pd.Series([1,2,3,4],index=['a','b','c','d'])
print(s.iloc[2:4])
b 2
c 3
d 4
dtype: int64
b 3
c 4
dtype: int64
c 3
d 4
dtype: int64
none of the above
write the output:
import pandas as pd
s=pd.Series([1,2,3,4],index=['a','b','c','d'])
print(s.loc['b':'d'])
b 2
c 3
d 4
dtype: float64
b 2
c 3
d 4
dtype: object
c 3
d 4
dtype: int64
b 2
c 3
d 4
dtype: int64
