Re: reshape() (was Re: Fw: Wrapup time)
[email protected] (Nathan Wiger) Wed, 13 Sep 2000 18:09:09 -0700
| Newsgroups | perl.perl6.language.data |
|---|---|
| Message-ID | <[email protected]> |
Jeremy Howard wrote: > > That looks good, except that I'd remove the interleaving. Currently, it's > not clear how to reshape() to more than 2 dimensions, because the third > argument of the first list ref is the interleave flag. We should be able to > be able to reshape to any number of dimensions: You've convinced me, I'll take it out. > rather use a transpose() function for this that can transpose across a given > axis. You'll be RFC'ing that, I suppose? ;-) (But seriously, it sounds like a good idea) > I don't think we need to define the ability to work on multiple lists as > special behaviour. Perl knows how to flatten lists, so any syntax we define > will allow multiple lists simply by letting Perl join and flatten them. Right, unless you make the list the first argument, like NumPy: @b = rehape @a, [1,2]; Then you're in trouble. > Finally, I think the dimensions specified by reshape() should be the maximum > index of the axis, not the number of elements, since this way it matches the > :bounds semantics. In this case, the wildcard would clearly need to -1. This sounds reasonable, but maybe just clarify this a little? Feel free to send me volumes of examples offline if need be. -Nate