程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

python_ data_ analysis_ and_ mining_ action-master-10

編輯:Python
#!/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 

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved