Informatics Practices

Consider the following series object namely S:

0 0.430271 
1 0.617328 
2 0.265421 
3 0.836113 
dtype: float64

What will be returned by the following statements?

(a) S * 100

(b) S > 0

(c) S1 = pd.Series(S)

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

Python Data Handling

2 Likes

Answer

(a) S * 100

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

(b) S > 0

Output
0    True
1    True
2    True
3    True
dtype: bool

(c) S1 = pd.Series(S)

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

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

Output
0    3.430271
1    3.617328
2    3.265421
3    3.836113
dtype: float64

Answered By

2 Likes


Related Questions