Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Data Import | Time Series
Time Series Essentials

book
Data Import

Methods description

  • pandas: This module provides data structures and functions for working with structured data, primarily tabular data. It includes classes like DataFrame and Series for representing data, as well as functions for reading and writing data from various file formats;

  • read_csv(filename): This method is used to read a CSV file and create a DataFrame from its contents;

  • head(num_rows): This method is used to display the first few rows of the DataFrame. By default, it shows the first 5 rows, but you can specify the number of rows to display.

Opgave

Swipe to start coding

  1. Import pandas as pd.
  2. Read the "passengers_data.csv" file.
  3. Show the first 5 rows of the dataset.

Løsning

import pandas as pd

df = pd.read_csv('passengers_data.csv')

df.head(5)

Mark tasks as Completed
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 2

Spørg AI

expand
ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

some-alt