On Tue, 26 Feb 2019, Artur T. wrote:
> - printing out an array of strings requires a loop if it has more
than 9
> elements. In some cases, this is VERY inconvenient. I see two way to go
> around this: either we introduce a "set" variable, which replaces the
> hard-wired limit at 10 we have now (something like "set arrayprint 20") or
> introduce an option to the print command ("--full" or similar). What do you
> guys prefer?
What about introducing another function named head() as in Python's pandas
package? The user would call <head(x,n)> where
- x is either a series, list, string array or matrix
- n is an integer specifying to show the first 'n' entries (default: 5 or)
The output is printed in column-format.
Similarly, there exists the tail() function in pandas show the last n
entries.
This would also be helpful when working with huge datasets where printing
output by <print x -o> already takes quite a while...
That's a good idea, although I'm a bit wary of introducing new cmmands.
How about options to "print"? That is, for example,
print X --head=10
would be equivalent to
smpl 1 10
print X --byobs
smpl full
except it'd be more efficient in that we don't really perform the
subsampling.
However, this would be ok when you print series/lists. The problem for
arrays would remain. Unless we generalise the above to something like
print A --start=3 --stop=12
Do you like it?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------