BaşlayınÜcretsiz Başlayın

Concatenate DataFrames

Let's assume you have gathered multiple datasets about your environment for the same time period, and would like to analyze them.

The first step is to combine the datasets into one, to comfortably work with them.

You'll work on combining the three DataFrames temperature, humidity, and windspeed.

Bu egzersiz

Analyzing IoT Data in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Rename the columns of the DataFrames to match "temperature", "humidity" and "windspeed".
  • Create a list of DataFrames df_list containing the DataFrames temperature, humidity, and windspeed, in this order.
  • Concatenate the list of DataFrames into one and name that environment. Each DataFrame should get it's own column.
  • Print the head of the combined DataFrame.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Rename the columns
temperature.columns = [____]
humidity.columns = ____
____

# Create list of DataFrames
df_list = [____]

# Concatenate files
environment = pd.concat(____, ____)

# Print first rows of the DataFrame
____
Kodu Düzenle ve Çalıştır