Last active
July 4, 2016 05:49
-
-
Save yeyuguo/ee5238d4c40633df3e81189398ba75ae to your computer and use it in GitHub Desktop.
一维的时间序列转成二维的,每天的放一个维度上
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| timesss=["20160504120000", "20160504130000", "20160504140000", "20160504150000", "20160504160000", "20160504170000", "20160504180000", "20160504190000", "20160504200000", "20160504210000", "20160504220000", "20160504230000", "20160505000000", "20160505010000", "20160505020000", "20160505030000", "20160505040000", "20160505050000", "20160505060000", "20160505070000", "20160505080000", "20160505090000", "20160505100000", "20160505110000", "20160505120000", "20160505130000", "20160505140000", "20160505150000", "20160505160000", "20160505170000", "20160505180000", "20160505190000", "20160505200000", "20160505210000", "20160505220000", "20160505230000", "20160506000000", "20160506010000", "20160506020000", "20160506030000", "20160506040000", "20160506050000", "20160506060000", "20160506070000", "20160506080000", "20160506090000", "20160506100000", "20160506110000", "20160506120000", "20160506130000", "20160506140000", "20160506150000", "20160506160000", "20160506170000", "20160506180000", "20160506190000", "20160506200000", "20160506210000", "20160506220000", "20160506230000", "20160507000000", "20160507010000", "20160507020000", "20160507030000", "20160507040000", "20160507050000", "20160507060000", "20160507070000", "20160507080000", "20160507090000", "20160507100000", "20160507110000", "20160507120000", "20160507130000", "20160507140000", "20160507150000", "20160507160000", "20160507170000", "20160507180000", "20160507190000", "20160507200000", "20160507210000", "20160507220000", "20160507230000", "20160508000000", "20160508010000", "20160508020000", "20160508030000", "20160508040000", "20160508050000", "20160508060000", "20160508070000", "20160508080000", "20160508090000", "20160508100000", "20160508110000", "20160508120000", "20160508130000", "20160508140000", "20160508150000", "20160508160000", "20160508170000", "20160508180000", "20160508190000", "20160508200000", "20160508210000", "20160508220000", "20160508230000", "20160509000000", "20160509010000", "20160509020000", "20160509030000", "20160509040000", "20160509050000", "20160509060000", "20160509070000", "20160509080000", "20160509090000", "20160509100000", "20160509110000", "20160509120000", "20160509130000", "20160509140000", "20160509150000", "20160509160000", "20160509170000", "20160509180000", "20160509190000", "20160509200000", "20160509210000", "20160509220000", "20160509230000", "20160510000000", "20160510010000", "20160510020000", "20160510030000", "20160510040000", "20160510050000", "20160510060000", "20160510070000", "20160510080000", "20160510090000", "20160510100000", "20160510110000", "20160510120000", "20160510130000", "20160510140000", "20160510150000", "20160510160000", "20160510170000", "20160510180000", "20160510190000", "20160510200000", "20160510210000", "20160510220000", "20160510230000", "20160511000000", "20160511010000", "20160511020000", "20160511030000", "20160511040000", "20160511050000", "20160511060000", "20160511070000", "20160511080000", "20160511090000", "20160511100000", "20160511110000", "20160511120000", "20160511130000", "20160511140000", "20160511150000", "20160511160000", "20160511170000", "20160511180000", "20160511190000", "20160511200000", "20160511210000", "20160511220000", "20160511230000", "20160512000000"] | |
| def day_handler(data): | |
| # keys = data.keys() | |
| # times = data['times'] | |
| times = data | |
| week_data = [] | |
| day_data = [] | |
| list_first = 0 | |
| for i,value in enumerate(times): | |
| if value[8:10] == '23': | |
| pop_val = times[list_first:i+1] | |
| week_data.append(pop_val) | |
| list_first = i+1 | |
| return week_data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment