0% found this document useful (0 votes)
9 views

Total Power Each Day

This document summarizes code that analyzes time series power consumption data. It calculates total daily power usage, visually explores individual columns over time with statistics, and resamples the data at different frequencies like hourly and daily to uncover patterns at different resolutions. The code examines occurrences of zero values in forecast data to determine if a system should wake, hibernate, or sleep based on whether zero persists in the short or long term.

Uploaded by

Aryan Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Total Power Each Day

This document summarizes code that analyzes time series power consumption data. It calculates total daily power usage, visually explores individual columns over time with statistics, and resamples the data at different frequencies like hourly and daily to uncover patterns at different resolutions. The code examines occurrences of zero values in forecast data to determine if a system should wake, hibernate, or sleep based on whether zero persists in the short or long term.

Uploaded by

Aryan Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

EDA:

Total Power Each Day:

This segment calculates the total power consumption for each day. It utilizes the groupby function
to aggregate the dataset based on the 'Date' column and then sums the 'Power_Watts' values. The
result is stored in a new DataFrame, per_date_power_analysis. Finally, a bar plot is generated using
Seaborn, illustrating the total power consumption per day. This visualization aids in understanding
daily trends and identifying potential patterns or anomalies in power usage.

Eg:

Data Visualization:

The second part of the EDA is dedicated to detailed data visualization of individual columns along
with statistical markers. A 3x3 subplot grid is created to accommodate the visualizations of nine
numerical columns. For each column, a line plot is generated to showcase the variation over time.
Additionally, statistical markers are incorporated: an average line represented by a red dashed line,
and markers for maximum and minimum values. The markers are color-coded for better distinction.

Eg:
Resampled Visualizations:

The final section focuses on resampling the data at different frequencies and visualizing the results.
The plot_resampled_data function is designed for this purpose. It takes as input the dataset and a
specified resampling frequency ('H' for hourly and 'D' for daily). The function internally utilizes
Pandas' resample method to aggregate data at the specified frequency and then plots the
resampled data. Subsequently, the visualizations are organized into a 3x3 subplot grid, offering a
comparative view of different resampled parameters. Additionally, a correlation plot is generated
using Seaborn's heatmap, providing insights into the relationships between resampled variables.
These resampled visualizations are instrumental in uncovering patterns at different temporal
resolutions, facilitating a more nuanced analysis of the dataset.

Eg:(Daily)
Eg: Hourly
Explanation of code logic:

The algorithm processes a time series data represented by the forecast list. It examines each
element in the series to identify occurrences of the value 0, which signifies the wake state. When the
algorithm encounters a 0 value and the previous state was not 0, it proceeds to analyze future
portions of the time series to make decisions about the system's behavior.

Firstly, it checks the next 1800 data points (half an hour) to determine if 0persists. If so, it prints
"wake," suggesting the system should be awake. If 0 is not found in this short-term window, it
extends the analysis to the subsequent 7200 data points (two hours). If 0i s found within this longer
window, it prints "Hibernate," indicating that the system should enter hibernation. If 0 is not found
in either window, it prints "sleep," suggesting the system can enter a lower power state.

The algorithm utilizes the prev_state variable to keep track of the previous state, enabling it to
detect transitions between states and make decisions based on changes in the time series data.

You might also like