Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pytools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pytools
Commits
50358fa8
Commit
50358fa8
authored
4 years ago
by
Matthias Diener
Browse files
Options
Downloads
Patches
Plain Diff
Table: add csv output
parent
78bd77cb
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
pytools/__init__.py
+12
-0
12 additions, 0 deletions
pytools/__init__.py
with
12 additions
and
0 deletions
pytools/__init__.py
+
12
−
0
View file @
50358fa8
...
...
@@ -1561,6 +1561,18 @@ class Table:
return
"
\n
"
.
join
(
lines
)
def
csv
(
self
):
"""
Returns a string containing a CSV representation of the table.
"""
import
csv
import
io
output
=
io
.
StringIO
()
writer
=
csv
.
writer
(
output
)
writer
.
writerows
(
self
.
rows
)
return
output
.
getvalue
().
rstrip
(
'
\n
'
)
def
latex
(
self
,
skip_lines
=
0
,
hline_after
=
None
):
if
hline_after
is
None
:
hline_after
=
[]
...
...
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