Q. Consider following Series object namely S:


0     0.430271

1     0.617328

2     -0.265421

3     -0.836113


dtype: float64


What will be returned by following statements?


(a) S * 100

(b) S > 0

(c) S1 = pd.Series(S)

(d) S3 = pd.Series(S1) + 3


What will be the values of Series objects S1 and S2 created above ?


Answer =

(A) S*100

0    43.0271
1    61.7328
2   -26.5421
3   -83.6113
dtype: float64


(B) S>0

0     True
1     True
2    False
3    False
dtype: bool

(C) S1=pd.Series(S)

0    0.430271
1    0.617328
2   -0.265421
3   -0.836113
dtype: float64

(D) S3=pd.Series(S1) + 3

0    3.430271
1    3.617328
2    2.734579
3    2.163887
dtype: float64

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post