joinDf.py 472 Bytes
Newer Older
Iker Martín's avatar
Iker Martín committed
1
2
3
4
5
6
import sys
import glob
import numpy as numpy
import pandas as pd

if len(sys.argv) < 3:
Iker Martín Álvarez's avatar
Iker Martín Álvarez committed
7
    print("The files name is missing\nUsage: python3 joinDf.py resultsName1.pkl resultsName2.pkl OutName")
Iker Martín's avatar
Iker Martín committed
8
9
10
11
12
13
14
    exit(1)

if len(sys.argv) >= 4:
  name = sys.argv[3]
else:
  name = "dataJOINED"

Iker Martín Álvarez's avatar
Iker Martín Álvarez committed
15
16
17
print("File name will be: " + name + ".pkl")
df1 = pd.read_pickle( sys.argv[1] )
df2 = pd.read_pickle( sys.argv[2] )
Iker Martín's avatar
Iker Martín committed
18
19
20
frames = [df1, df2]
df3 = pd.concat(frames)

Iker Martín Álvarez's avatar
Iker Martín Álvarez committed
21
df3.to_pickle(name + '.pkl')