Course Content
Pandas First Steps
Pandas First Steps
max() and min()
pandas
provides the max()
method, which returns the highest value from a specified column.
To identify the highest value of a specific column, you can use this approach:
Similarly, pandas
offers the min()
method that fetches the smallest value from a given column.
To determine the smallest value for a particular column, the same method is used:
Swipe to start coding
You are given a DataFrame
named audi_cars
.
- Find the highest price in the
'price'
column and store the result in themax_value
variable. - Find the lowest price in the
'price'
column and store the result in themin_value
variable. - Compute the average price in the
'price'
column and store the result in themean_value
variable.
Solution
Thanks for your feedback!
max() and min()
pandas
provides the max()
method, which returns the highest value from a specified column.
To identify the highest value of a specific column, you can use this approach:
Similarly, pandas
offers the min()
method that fetches the smallest value from a given column.
To determine the smallest value for a particular column, the same method is used:
Swipe to start coding
You are given a DataFrame
named audi_cars
.
- Find the highest price in the
'price'
column and store the result in themax_value
variable. - Find the lowest price in the
'price'
column and store the result in themin_value
variable. - Compute the average price in the
'price'
column and store the result in themean_value
variable.
Solution
Thanks for your feedback!