Skip to content

Instantly share code, notes, and snippets.

View nipunbatra's full-sized avatar

Nipun Batra nipunbatra

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cols_to_use = []
for degree in range(1, 360, 2):
cols_to_use.append("Latitude."+str(degree))
cols_to_use.append("Longitude."+str(degree))
import os
appliances = ["hvac","fridge","wm","mw","dw","oven"]
appliances = ['hvac','fridge']
features = ["Static","Monthly","Monthly+Static"]
features=["Monthly+Static","Static","Monthly"]
SLURM_OUT = "../slurm_out"
if not os.path.exists(SLURM_OUT):
os.makedirs(SLURM_OUT)
import json
f = open("/Users/nipunbatra/Downloads/testHP.drw",'r')
stream = f.read()
stream = stream.replace("\n",'')
stream = stream.replace("\xef\xbb\xbf","")
stream = stream.replace("HP := ","")
stream = stream.replace(":","")
three_d_array = json.loads(stream)
#shape
In [16]: e = json.load(open("/Users/nipunbatra/Downloads/test_dk.txt",'r'))
In [17]: e
Out[17]: [[[2, 3], [4, 5]], [[1, 2], []]]

Some of these questions have been asked on various forums (mail/github) and I thought of addressing them here:

Question 1. When I looked into the appliance level data (3.csv, 4.csv, etc.) and compare with mains, I observed that each appliance starting time period is different for example, fridge starts from 7th June and Washing machine starts from 10th June, whereas mains have data from 22nd May.

This is correct. We used jPlugs for collecting our appliance level data. Our smart meter deployment to collect mains data started a few days before the data collection for different appliances. jPlugs would collect data only when the appliance was ON. Thus, washing machine data starts from 10th June, the day it was first used during the data collecion.

Question 2. What is the best start and end time for using electricity data?

The nilmtk HDF5 I created uses data between 7-13-2013 and 8-4-2013. This period has the maximum amount of sensor data available.

import pandas as pd
df = pd.read_csv("server_idle.csv")
ax = df.throughput.plot('ko-')
plt.xticks(range(len(df)), df["# threads"])