Browse Source

Collate 5k

Petra Lamborn 5 years ago
parent
commit
83039c973a
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      py/collate.py

+ 5
- 4
py/collate.py View File

@@ -1,19 +1,20 @@
1 1
 # Collate 12 dataframes into one (wide) combined dataframe
2 2
 import pandas as p
3 3
 import gc
4
+from tqdm import tqdm
4 5
 
5 6
 
6 7
 months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
7 8
 
8
-coldf = p.read_pickle('../data/2017-{}-all.pkl'.format(months[0]))
9
+coldf = p.read_pickle('../data/2017-{}-5k.pkl'.format(months[0]))
9 10
 
10
-for i in range(1, 12):
11
-    tdf = p.read_pickle('../data/2017-{}-all.pkl'.format(months[i])) 
11
+for i in tqdm(range(1, 12)):
12
+    tdf = p.read_pickle('../data/2017-{}-5k.pkl'.format(months[i])) 
12 13
     coldf = p.concat([coldf, tdf])
13 14
     del tdf
14 15
     gc.collect()
15 16
 
16 17
 print(coldf.info())
17 18
 
18
-coldf.to_pickle('../data/2017-all-wide.pkl')
19
+coldf.to_pickle('../data/2017-5k-wide.pkl')
19 20