DBCOLHISTO(1)
π
DBCOLHISTO(1) β the dbcolhisto era β¨
okay bestie, so this is the manual page for dbcolhisto, a lil Perl situation from the User Contributed Perl Documentation corner of the universe, and honestly? it's giving "I count things in buckets" and I'm obsessed. let's get into it π
πΈ NAME πΈ
dbcolhisto β literally computes a histogram over a column of Fsdb data. that's the whole vibe. no cap.
β¨ SYNOPSIS β¨
dbcolhisto [-ag] [-W BucketWidth] [-S BucketStart] [-E BucketEnd] [-N
NumberOfBuckets] column
π¦ DESCRIPTION π¦
so this program computes a histogram over a column of data. records containing non-numeric data are considered null and do not contribute to the stats β but optionally they can be treated as zeros instead, which is a whole different vibe, iykyk.
it defaults to 10 buckets over the exact range of data. up to three parameters (number of buckets, start, end, and width) can be specified, and the rest default accordingly. π«
buckets range from a value (given the low column) to just below the next low value, and buckets are equal width. if necessary, extra "<min" and ">max" buckets get created. by default, the last bucket includes max (and is thus infinitesimally larger than the other buckets). this irregularity can be removed with the -I option. main character bucket energy only π
this program requires O(number of buckets) memory and O(size of data) temporary disk space. efficiency queen π
π OPTIONS π
-Wor--width Nβ gives with width of each bucket, in data units. default is whatever gives 10 buckets over the whole range of data.-Sor--start Nβ buckets start at value N, in data units. default is the minimum data value.-Eor--end Nβ buckets end at value N, in data units. default is the maximum data value.-Nor--number Nβ create N buckets. the default is 10 buckets.-gor--graphicalβ generate a graphical histogram (with asterisks). default is numeric. asterisks are honestly so retro-cute π-Ior--last-inclusiveβ make the last bucket non-inclusive of the last value.-aβ compute stats over all records (treat non-numeric records as zero rather than just ignoring them). default is non-numeric records are ignored.-e EmptyValueor--emptyβ specify the value any null bins get. (Default:-.)
π the standard fsdb options (this module supports these too, slay) π
-dβ enable debugging output.-ior--input InputSourceβ read from InputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--output OutputDestinationβ write to OutputDestination, typically a file name, or"-"for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. the"--(no)autorun"option controls that behavior within Perl.--helpβ show help. π«Ά--manβ show full manual. (you're literally reading it rn π)
β SAMPLE USAGE β
π Input:
#fsdb name id test1
a 1 80
b 2 70
c 3 65
d 4 90
e 5 70
f 6 90
π§ Command:
cat DATA/grades.fsdb | dbcolhisto -S 0 -E 100 -N 10 test1
π₯ Output:
#fsdb low histogram:q
0 0
10 0
20 0
30 0
40 0
50 0
60 1
70 2
80 1
90 2
# | dbcolhisto -S 0 -E 100 -N 10 test1
ate. no crumbs. π
π SEE ALSO π
Fsdb, dbcolpercentile, dbcolstats β go read those too, bestie, they're lowkey iconic.
π BUGS π
this program could run in constant memory with no external storage when the buckets are pre-specified. that optimization is not implemented. so close to perfection and yetβ¦ π
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2022 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.
and that's the whole page, bestie π this was perl v5.32.1, dated 2024-08-02 β mwah, go compute some gorgeous little buckets for me πβ¨
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms