Diff of /read_pickle_file.py [000000] .. [bb7f56]

Switch to unified view

a b/read_pickle_file.py
1
import pickle
2
import pandas as pd
3
import code
4
5
class ReadPickle:
6
  def __init__(self,input):
7
8
      self.input = input
9
10
  def fix_df(self,df):
11
12
      df = df.assign(class_target=int(1))
13
14
      df.to_pickle(os.path.join(os.path.dirname(self.input), 'info_df_new.pickle'))
15
16
  def run(self):
17
      
18
      df = pd.read_pickle(self.input)
19
      #file = pickle.load(open(self.input,"rb"))
20
      code.interact(local=locals())
21
      with pd.option_context('display.max_rows', None, 'display.max_columns', None):  # more options can be specified also
22
         print(df)
23
24
25
if __name__ == "__main__":
26
27
  #Command line parsing module
28
  import argparse
29
30
  parser = argparse.ArgumentParser(description='ParserForReadingPickleFile')
31
32
  parser.add_argument("--file",dest="input",required=True)
33
34
  op  = parser.parse_args()
35
36
37
  picklereader = ReadPickle(op.input)
38
39
  picklereader.run()