forked from 1111joe1111/ida_ea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ea_read_t.py
56 lines (42 loc) · 1.43 KB
/
ea_read_t.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import pandas as pd
from pickle import load
import pandas.io.formats.format as pf
from code import interact
from sys import argv
class IntArrayFormatter(pf.GenericArrayFormatter):
def _format_strings(self):
fmt_values = [
'0x{:016x}'.format(x) for x in self.values
]
return fmt_values
def read(file):
with open(file, "r") as r:
return r.read()
def filter_df(conditions):
return pd.concat(conditions, axis=1).all(axis=1)
def load_df(path):
with open(path,"rb") as r:
df = load(r)
df = df.set_index(pd.DatetimeIndex(df["time"] * 1000000000).time)
del df["time"]
return df
pd.options.display.max_rows = 200
pd.options.display.width = 10000
pd.options.display.max_colwidth = 20
pd.options.display.max_columns = 7
pf.IntArrayFormatter = IntArrayFormatter
if __name__ == "__main__":
df = load_df(argv[1])
print
print df
print
print "dataframe name: df"
print "dataframe columns: %s" % list(df.columns)
print
print "current settings:"
print "pd.options.display.max_rows".ljust(50) + str(pd.options.display.max_rows)
print "pd.options.display.width".ljust(50) + str(pd.options.display.width)
print "pd.options.display.max_colwidth".ljust(50) + str(pd.options.display.max_colwidth)
print "pd.options.display.max_columns".ljust(50) + str(pd.options.display.max_columns)
print ""
interact(local=globals())