Informatics Practices

Consider the following DataFrame df and answer any four questions from (i)-(v):

rollnonameUT1UT2UT3UT4
1Prerna Singh24242022
2Manish Arora18171922
3Tanish Goel20221824
4Falguni Jain22202420
5Kanika Bhatnagar15201822
6Ramandeep Kaur20152224

Write down the command that will give the following output :

roll no 6
name    Tanish Goel
UT1     24
UT2     24
UT3     24
UT4     24
dtype : object

(a) print(df.max)

(b) print(df.max())

(c) print(df.max(axis = 1))

(d) print(df.max, axis = 1)

Python Pandas

3 Likes

Answer

print(df.max())

Explanation

The df.max() function in pandas is used to find the maximum value in each column of a DataFrame.

Answered By

2 Likes


Related Questions