Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dios
Manage
Activity
Members
Labels
Plan
Issues
11
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RDM
dios
Commits
faffd8c8
Commit
faffd8c8
authored
4 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
minor improves
parent
13614dbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dios/dios.py
+9
-13
9 additions, 13 deletions
dios/dios.py
with
9 additions
and
13 deletions
dios/dios.py
+
9
−
13
View file @
faffd8c8
...
...
@@ -354,7 +354,7 @@ class DictOfSeries:
locations, just like `series.loc[:]=val` or `df[:]=val` do.
Eg.
di
1
[::2] = di[::3] -> di[::2]
di[::2] = di[::3] -> di[::2]
x | x | x |
===== | ==== | ====== |
...
...
@@ -767,7 +767,7 @@ def pprint_dios(dios,
# now data only contains series that we want to print.
# if any series exceed max_rows we trim all series to min_rows
series_lengths
=
data
.
apply
(
len
)
series_lengths
=
data
.
apply
(
len
)
.
to_list
()
series_maxlen
=
max
(
series_lengths
)
trunc_rows
=
series_maxlen
>
max_rows
max_rows
=
min_rows
if
trunc_rows
else
series_maxlen
...
...
@@ -812,7 +812,7 @@ def pprint_dios(dios,
# columns.
valstr_len
=
[
len
(
c
[
0
])
for
c
in
outer
]
rows
=
max_rows
+
1
# colname
rows
=
max_rows
+
1
# colname
s aka. header
rows
+=
1
if
trunc_rows
else
0
# `...` in rows
rows
+=
1
if
header_delim
else
0
# underline header
...
...
@@ -821,10 +821,11 @@ def pprint_dios(dios,
colheader
=
(
header_delim
*
valstr_len
[
i
])[:
valstr_len
[
i
]]
c
.
insert
(
1
,
colheader
)
d
elim
=
'
...
'
d
ots
=
'
...
'
if
trunc_cols
:
outer
.
insert
(
max_cols
//
2
,
[
delim
]
*
rows
)
valstr_len
.
insert
(
max_cols
//
2
,
len
(
delim
))
outer
.
insert
(
max_cols
//
2
,
[
dots
]
*
rows
)
valstr_len
.
insert
(
max_cols
//
2
,
len
(
dots
))
series_lengths
.
insert
(
max_cols
//
2
,
rows
)
txt
=
""
for
r
in
range
(
rows
):
...
...
@@ -838,17 +839,12 @@ def pprint_dios(dios,
# add footer
if
show_dimensions
:
# correction because the collections `series_lengths`
# and `valstr_len` differ by 1 in length. very hacky!
# todo: use a dict/df or dios(?!) to store the str-data
corr
=
0
for
i
,
c
in
enumerate
(
outer
):
# ignore the dot-column
if
trunc_cols
and
i
==
max_cols
//
2
:
txt
+=
delim
+
'
'
*
len
(
col_delim
)
corr
=
1
txt
+=
dots
+
'
'
*
len
(
col_delim
)
else
:
txt
+=
f
"
[
{
series_lengths
.
iat
[
i
-
corr
]
}
]
"
.
ljust
(
valstr_len
[
i
]
+
len
(
col_delim
))
txt
+=
f
"
[
{
series_lengths
[
i
]
}
]
"
.
ljust
(
valstr_len
[
i
]
+
len
(
col_delim
))
txt
+=
f
'
\n\n
max: [
{
maxlen
}
rows x
{
len
(
dios
.
columns
)
}
columns]
'
txt
+=
'
\n
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment