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

Tidy data

Reshaping your data has several applications. One important application is to switch from a data analytics friendly to a reporting friendly format. This concept is further expanded in the Tidy data paper by Hadley Wickham.

Data in a tidy format also allows you to perform groupby operations as seen in the previous exercise.

In this exercise you will use melt() and .pivot_table() from pandas to reshape your data from one shape to another. Remember that when you call .pivot_table() on your data, you also need to call the .reset_index() method to get your original DataFrame back.

Before you start reshaping the airquality DataFrame, inspect it in the shell. We've imported pandas as pd.

Bu egzersiz

Python for R Users

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Melt the airquality DataFrame
airquality_melted = ____(____, id_vars=['Day', 'Month'])
print(airquality_melted)
Kodu Düzenle ve Çalıştır