Update table.
This commit is contained in:
parent
8aa3d06b19
commit
82418bd6c3
@ -62,16 +62,14 @@ class tabledf(table):
|
||||
super().__init__(**kargs)
|
||||
if header is None:
|
||||
multilevels, header = self.create_header(df)
|
||||
df = df.reset_index()
|
||||
if multilevels:
|
||||
ncols = len(header[-1])
|
||||
df = df.reset_index()
|
||||
else:
|
||||
ncols = len(header)
|
||||
header = [header]
|
||||
tab = tabular(columns='r' * ncols)
|
||||
if multilevels:
|
||||
tab.addrows(header)
|
||||
else:
|
||||
tab.addrow(header)
|
||||
tab.addrows(header)
|
||||
tab.addhline()
|
||||
tab.addrows(df.astype(object).values, fmt=fmt)
|
||||
self.add(tab)
|
||||
|
Loading…
Reference in New Issue
Block a user