#13131: Make a top-level table/Table function
----------------------------------+-----------------------------------------
Reporter: kcrisman | Owner: was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.9
Component: user interface | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Jason Grout, Karl-Dieter
Crisman
Authors: John Palmieri | Merged in:
Dependencies: | Stopgaps:
----------------------------------+-----------------------------------------
Comment (by jhpalmieri):
Replying to [comment:24 slabbe]:
> Thanks for clarifying the documentation of `html(_)` and for making
`html` calling `_html_` if it exists.
>
> I have two questions:
>
> 1. Doc of `html` now says:
>
> {{{
> In any case, *print* the resulting html string. This method
> always *returns* an empty string.
> }}}
>
> What if I want to print the output in a file and not in the shell. What
should I do? This is something I came across in the past.
This is just documentation; I haven't changed the code. If we want to
change the behavior of `html` (maybe just adding a `str` method or
something like that), let's do it on another ticket and keep this one
focused on tables.
> 2. I really like the `table` function. I am defining such a function in
a patch I posted just yesterday at #13069. In my case, the function takes
columns as input and not rows. So, if I want to use your code, would you
propose an interface that takes columns as input:
>
> {{{
> #!python
> sage: columns = [('a', 100, 4), ('b', 2, 5), ('c', 3, 60)]
> sage: table(columns=columns)
> }}}
I can add this, but what should happen if you do `table(array,
column=columns)`? Raise an error? Or try to combine the two sets of data
somehow? I think I prefer to raise an error.
> or the user should transpose columns into rows himself?
The easiest thing to do with the code as it stands is
`table(columns).transpose()`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13131#comment:28>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.