Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Exploring Data [2/3] | Reading and Exploring Data
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
Exploring Data [2/3]

DataFrame size

To get the dimensionality of DataFrame (i.e., number of rows and columns), use the .shape attribute. It will return a tuple (immutable list-like structure) with 2 values: the first one is the number of rows, the second one is the number of columns.

1234567
# 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') # DataFrame' dimensionality print(df.shape)
copy

Values' types

Before aggregating and visualizing data, you need to understand are these data have appropriate formats. For example, you may face the situation when prices will be represented in text form - this will make impossible to aggregate it. To get the columns values' types, use the .dtypes attribute.

1234567
# 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') # Columns values' types print(df.dtypes)
copy

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 5

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
Exploring Data [2/3]

DataFrame size

To get the dimensionality of DataFrame (i.e., number of rows and columns), use the .shape attribute. It will return a tuple (immutable list-like structure) with 2 values: the first one is the number of rows, the second one is the number of columns.

1234567
# 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') # DataFrame' dimensionality print(df.shape)
copy

Values' types

Before aggregating and visualizing data, you need to understand are these data have appropriate formats. For example, you may face the situation when prices will be represented in text form - this will make impossible to aggregate it. To get the columns values' types, use the .dtypes attribute.

1234567
# 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') # Columns values' types print(df.dtypes)
copy

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 5
Vi beklager at noe gikk galt. Hva skjedde?
some-alt