Skip to main content
added 778 characters in body
Source Link
Henry Davis
  • 133
  • 2
  • 11

Find Print out largest value infrom column in Pandas?

I have thiswas given a task where I haveI'm supposed to find the largest N value in 'Salary' column and print the value. How do i do that?

Here's the code:

    import numpy as np
    import pandas as pd 
    # TODO: Find the largest number in 'Salary' column
    
    data_one = pd.read_excel("C:\\Users\\HP\\Documents\\DataScience task\\Employee.xlsx")
    dataframe_data = pd.DataFrame(data_one)
    find_largest_salary = dataframe_data['Salary']

Output:

    First Name  Last Name   Gender  Age Experience (Years)  Salary
0   Arnold  Carter  Male            21  10                   8344

    1   Arthur  Farrell Male        20  7                    6437
    2   Richard Perry   Male        28  3                    8338
    3   Ellia   Thomas  Female      26  4                    8870
    4   Jacob   Kelly   Male        21  4                    548
    ... ... ... ... ... ... ...
    95  Leonardo    Barnes  Male    23  6                    7120
    96  Kristian    Mason   Male    21  7                    7018
    97  Paul    Perkins Male        21  6                    2929
    98  Justin  Moore   Male        25  0                    3141
    99  Naomi   Ryan    Female      22  10                   7486

The output I wanted (example):

99999

Find largest value in column Pandas?

I have this task where I have to find the largest N value in 'Salary' column. How do i do that?

Here's the code:

    import numpy as np
    import pandas as pd 
    # TODO: Find the largest number in 'Salary' column
    
    data_one = pd.read_excel("C:\\Users\\HP\\Documents\\DataScience task\\Employee.xlsx")
    dataframe_data = pd.DataFrame(data_one)
    find_largest_salary = dataframe_data['Salary']

Print out largest value from column in Pandas

I was given a task where I'm supposed to find largest value in 'Salary' column and print the value.

Here's the code:

    import numpy as np
    import pandas as pd 
    # TODO: Find the largest number in 'Salary' column
    
    data_one = pd.read_excel("C:\\Users\\HP\\Documents\\DataScience task\\Employee.xlsx")
    dataframe_data = pd.DataFrame(data_one)
    find_largest_salary = dataframe_data['Salary']

Output:

    First Name  Last Name   Gender  Age Experience (Years)  Salary
0   Arnold  Carter  Male            21  10                   8344

    1   Arthur  Farrell Male        20  7                    6437
    2   Richard Perry   Male        28  3                    8338
    3   Ellia   Thomas  Female      26  4                    8870
    4   Jacob   Kelly   Male        21  4                    548
    ... ... ... ... ... ... ...
    95  Leonardo    Barnes  Male    23  6                    7120
    96  Kristian    Mason   Male    21  7                    7018
    97  Paul    Perkins Male        21  6                    2929
    98  Justin  Moore   Male        25  0                    3141
    99  Naomi   Ryan    Female      22  10                   7486

The output I wanted (example):

99999
Post Closed as "Duplicate" by Mayank Porwal pandas
Source Link
Henry Davis
  • 133
  • 2
  • 11

Find largest value in column Pandas?

I have this task where I have to find the largest N value in 'Salary' column. How do i do that?

Here's the code:

    import numpy as np
    import pandas as pd 
    # TODO: Find the largest number in 'Salary' column
    
    data_one = pd.read_excel("C:\\Users\\HP\\Documents\\DataScience task\\Employee.xlsx")
    dataframe_data = pd.DataFrame(data_one)
    find_largest_salary = dataframe_data['Salary']