#13131: Make a top-level table/Table function
----------------------------------+-----------------------------------------
Reporter: kcrisman | Owner: was
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-5.7
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:14 kcrisman]:
> Some dumb questions.
> * ` elif header_row is not False:` why not just ` elif header_row`?
Presumably a Python subtlety.
I think that can be changed.
> * Do we need something in `html.table()` (what remains of it) to change
it so that the previous behavior of a single list giving a column and not
a row is preserved? I know you removed the example, but technically
speaking one should deprecate this...
Technically speaking, I think you're right. I don't like the old behavior
at all; it doesn't make sense to me. It might actually make sense to just
raise an error if you pass a single list, not a nested list. I'm not sure
what the right thing to do is.
> * Is there an extra
> {{{
> self._options['header_column'] = header_column
> }}}
> in there? It should be set already above that.
Yes, you're right.
> * I don't see any error catching. This is particularly important in
making sure someone doesn't (contra the doc, but still) try to add in a
header row later on via `header_row=[1,2,3]`
So you're suggesting that
{{{
sage: T = table([[1,2,3], [4,5,6]])
sage: T.options(header_row=['x', 'y', 'z'])
}}}
should raise an error instead of just silently making `[1,2,3]` the
header? Okay, I guess that makes sense.
> and in making sure that the table is, in fact, a rectangle. I think
that for sanity, especially with very large tables, this would be helpful
to have this error instead of who-knows-what-crazy-error Sage would raise
otherwise.
> * Feature request; take a list of lists and just fill in the rest! I
had to make my own code for this in some sense, filling in empty slots, if
I recall correctly. But presumably this is like the list in comment:2 and
for a future ticket.
I'm not sure how these last two items relate to each other: the last one
sounds like you want to be able to pass lists of different lengths and
have the gaps filled in, and the previous one sounds like you want to
raise an error if you pass lists of different lengths. But maybe I don't
understand.
Would it be useful to have a `transpose` method to switch rows and
columns? Here's a new patch which adds that, and also addresses all of the
issues except the old behavior of `html.table()` and the last issue about
a non-rectangular situation.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13131#comment:21>
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.