Reformat data
Based on the data gathered in the previous exercise, you can see that you have data for 2 different areas, area1
and area2
.
To easily compare and analyze this data, you should bring each device into its own column.
To load the data, you specify your own column names, since you did not save these with the data.
After loading the data, you need to convert the timestamp. The timestamp is in milliseconds, which we need to tell to_datetime
by specifying unit="ms"
.
You pivot the data and resample the data to 1-minute intervals since for this dataset, a more detailed analysis would not make sense.
Este exercício faz parte do curso
Analyzing IoT Data in Python
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Replace the timestamp with the parsed timestamp
df['ts'] = pd.____(df["ts"], ____=____)
print(df.head())