Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Reading CSV Files | 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
Reading CSV Files

As a data analyst, you most likely will not create DataFrames by yourself - often you will work with some tabular data, most likely stored in the csv format.

To read a csv file, use the pd.read_csv() function, passing the path to file (web link, or path in file system). When reading, you may set the column that will be used as indexes (index_col parameter, either column' name, or index).

During this course, we will work with one dataset audi_cars (source). This dataset contains information of price, transmission, mileage, fuel type, road tax, miles per gallon (mpg), and engine size of used cars. First, let's read this file (from web link).

123456
# 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') print(df)
copy

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 1

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
Reading CSV Files

As a data analyst, you most likely will not create DataFrames by yourself - often you will work with some tabular data, most likely stored in the csv format.

To read a csv file, use the pd.read_csv() function, passing the path to file (web link, or path in file system). When reading, you may set the column that will be used as indexes (index_col parameter, either column' name, or index).

During this course, we will work with one dataset audi_cars (source). This dataset contains information of price, transmission, mileage, fuel type, road tax, miles per gallon (mpg), and engine size of used cars. First, let's read this file (from web link).

123456
# 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') print(df)
copy

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

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