dbcolpercentile - compute percentiles or ranks for an existing column
dbcolpercentile [-rplhS] column
Compute a percentile of a column of numbers. The new column will be called percentile or rank. Non-numeric records are handled as in other programs.
If the data is pre-sorted and only a rank is requested, no extra storage is required. In all other cases, a full copy of data is buffered on disk.
Show percentile (default). Percentile is the percentage of the cumulative values at or lower than the current value, relative to the total count.
Compute ranks instead of percentiles.
Show fraction (percentage, except between 0 and 1, not cumulative fraction).
Compute stats over all records (treat non-numeric records as zero rather than just ignoring them).
Assume data is already sorted. With one -S, we check and confirm this precondition. When repeated, we skip the check.
Specify a printf(3)-style format for output statistics. Defaults to %.5g.
%.5g
where to put tmp files. Also uses environment variable TMPDIR, if -T is not specified. Default is /tmp.
Sort specification options (can be interspersed with column names):
sort in reverse order (high to low)
sort in normal order (low to high)
sort numerically (default)
sort lexicographically
This module also supports the standard fsdb options:
Enable debugging output.
Read from InputSource, typically a file name, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
-
Write to OutputDestination, typically a file name, or - for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
By default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The --(no)autorun option controls that behavior within Perl.
--(no)autorun
Show help.
Show full manual.
#fsdb name id test1 a 1 80 b 2 70 c 3 65 d 4 90 e 5 70 f 6 90
cat DATA/grades.fsdb | dbcolpercentile test1
#fsdb name id test1 percentile d 4 90 1 f 6 90 1 a 1 80 0.66667 b 2 70 0.5 e 5 70 0.5 c 3 65 0.16667 # | dbsort -n test1 # | dbcolpercentile test1
cat DATA/grades.fsdb | dbcolpercentile --rank test1
#fsdb name id test1 rank d 4 90 1 f 6 90 1 a 1 80 3 b 2 70 4 e 5 70 4 c 3 65 6 # | dbsort -n test1 # | dbcolpercentile --rank test1
Fsdb. dbcolhisto.
$filter = new Fsdb::Filter::dbcolpercentile(@arguments);
Create a new dbcolpercentile object, taking command-line arguments.
$filter->set_defaults();
Internal: set up defaults.
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
$filter->setup();
Internal: setup, parse headers.
$n = $self->_count_rows()
Interpose a filter on $self-{_in}> that counts the rows.
$self-
$filter->run();
Internal: run over each rows.
Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.
To install Fsdb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fsdb
CPAN shell
perl -MCPAN -e shell install Fsdb
For more information on module installation, please visit the detailed CPAN module installation guide.