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

Analyzing Energy counter data

Simply plotting energy counter data will not show anything other than 2 straight lines.

The energy counter gives you a running total, but what you really care about his how much energy was consumed between each measurement.

You need to calculate the difference between 2 consecutive values to see how much energy has been consumed in each interval. Creating the percentage-change from the difference allows for easier comparison and allows new insights.

pandas has already been imported as pd, and matplotlib.pyplot as plt. The DataFrame is available as df.

Bu egzersiz

Analyzing IoT Data in Python

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Get difference between values
____

# Plot the DataFrame
df_diff.plot()
plt.show()
Kodu Düzenle ve Çalıştır