Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Minimum and Maximum | Aggregate Functions
Introduction to pandas [track]
course content

Kursinnhold

Introduction to pandas [track]

Introduction to pandas [track]

1. Basics
2. Reading and Exploring Data
3. Accessing DataFrame Values
4. Aggregate Functions

book
Minimum and Maximum

You can also get the minimum and maximum values of certain column. To get the minimum apply the .min() method, to get the maximum apply the .max() method. For instance,

123456789
# Importing library import pandas as pd # Reading csv file df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/67798cef-5e7c-4fbc-af7d-ae96b4443c0a/audi.csv') # Minimal car price with Automatic gear box print(df.loc[df.transmission == 'Automatic', 'price'].min()) # Maximal mileage of manufactured in 2015 car print(df.loc[df.year == 2015, 'mileage'].max())
copy

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 8

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

course content

Kursinnhold

Introduction to pandas [track]

Introduction to pandas [track]

1. Basics
2. Reading and Exploring Data
3. Accessing DataFrame Values
4. Aggregate Functions

book
Minimum and Maximum

You can also get the minimum and maximum values of certain column. To get the minimum apply the .min() method, to get the maximum apply the .max() method. For instance,

123456789
# Importing library import pandas as pd # Reading csv file df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/67798cef-5e7c-4fbc-af7d-ae96b4443c0a/audi.csv') # Minimal car price with Automatic gear box print(df.loc[df.transmission == 'Automatic', 'price'].min()) # Maximal mileage of manufactured in 2015 car print(df.loc[df.year == 2015, 'mileage'].max())
copy

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 8
Vi beklager at noe gikk galt. Hva skjedde?
some-alt