Q. Consider the dataframe wdf as shown below.


 

min Temp

Max Temp

Rainfall

Evaporation

0

2.9

8.0

24.3

0.0

1

3.1

14.0

26.9

3.6

2

6.2

13.7

23.4

3.6

3

5.3

13.3

15.5

39.8

4

6.3

17.6

16.1

2.8

5

5.4

18.2

16.9

0.0

6

5.5

21.1

18.2

0.2

7

4.8

18.3

17.0

0.0

8

3.6

20.8

19.5

0.0

9

7.70

19.4

22.8

16.2

10

9.90

24.1

25.2

0.0

11

11.80

28.5

27.3

0.2

12

13.20

29.1

27.9

0.0

13

16.8

24.1

30.9

0.0

14

19.40

28.1

31.2

0.0

15

21.6

34.4

32.1

0.0

16

20.4

33.8

31.2

0.0

17

18.5

26.7

30.0

1.2

18

18.8

32.4

32.3

0.6

19

17.6

28.6

33.4

0.0

20

19.7

30.3

33.4

0.0


(a) Write statement(s) to calculate minimum value for each of the columns.

(b) Write statement(s) to calculate maximum value for each of the rows.

(c) Write statement(s) to calculate variance for column Rainfall.

(d) Write statement(s) to compute mean, mode median for last 10 rows.


Answer =

(a) wdf.min()
(b) wdf.max(axis=1)
(c) wdf.Rainfall.var()
(d) wdf.tail(10).mean()  , wdf.tail(10).mode()  , wdf.tail(10).median()




Post a Comment

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

Previous Post Next Post