#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 3 13:09:18 2017
@author: lu
"""
import numpy as np
import pandas as pd
from keras.layers.core import Activation, Dense
from keras.models import Sequential
"""
programmer_1--> Simple data filtering , Divide the data
programmer_2--> Threshold optimization ??? Don't understand, ..
programmer_3--> Build a training neural network , And test the model
programmer_4--> According to several characteristics, we can deduce whether a certain condition is satisfied
event_num--> The difference between adjacent times , Compare whether it is greater than the threshold
"""
def programmer_1():
# threshold
threshold = pd.Timedelta("4 min")
inputfile = "data/water_heater.xls"
outputfile = "tmp/dividsequence.xls"
data = pd.read_excel(inputfile)
# dataframe Handle
data[u" Time of occurrence "] = pd.to_datetime(data[u" Time of occurrence "], format="%Y%m%d%H%M%S")
data = data[data[u" Water flow "] > 0] # The flow is greater than 0
d = data[u" Time of occurrence "].diff() > threshold # adjacent
Why choose Python? Have to say
argparse library 01. Libraries