码迷,mamicode.com
首页 > 其他好文 > 详细

AI预测

时间:2019-03-23 00:55:46      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:http   use   plot   creat   orange   mes   src   str   dmi   

 

# -*- coding: utf-8 -*-
"""
Created on Fri Mar 22 21:03:34 2019

@author: Administrator
"""
import pandas as pd

filenames = []
basepath = D:\\pworkspace\\data\\Metro_train\\
for i in range(1, 26):
    if i < 10:
        filenames.append(basepath + record_2019-01-0 + str(i) + .csv)
    else:
        filenames.append(basepath + record_2019-01- + str(i) + .csv)

flag = True      
for filename in filenames:
    df = pd.read_csv(filename)
    df[time] = df[time].str[:-4] + 0:00
    df[time] = pd.to_datetime(df[time])
    df0 = df[df[stationID] == 0].copy()
    del df
    user_in = df0[df0[status] == 1]
    user_out = df0[df0[status] == 0]
    user_in = user_in.groupby(time)
    user_out = user_out.groupby(time)
    user_in = user_in.count()
    user_out = user_out.count()
    user_in[count] = user_in[userID]
    user_out[count] = user_out[userID]
    user_in = user_in.drop([lineID, stationID, deviceID,
                            status, payType, userID], axis=1)
    user_out = user_out.drop([lineID, stationID, deviceID,
                            status, payType, userID], axis=1)
    if flag:
        user_in_all = user_in
        user_out_all = user_out
        flag = False
    else:
        user_in_all = pd.concat([user_in_all,user_in], axis=0)
        user_out_all = pd.concat([user_out_all,user_out], axis=0)
        
user_in_all.plot(figsize=(15,8))
user_out_all.plot(figsize=(15,8), color=orange)

 

?技术图片

?技术图片

 

AI预测

标签:http   use   plot   creat   orange   mes   src   str   dmi   

原文地址:https://www.cnblogs.com/coshaho/p/10581742.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!