Table

From APL Wiki
Revision as of 05:40, 12 June 2020 by Bubbler (talk | contribs) (Created page with "{{Built-in|Table|⍪}}, or '''Ravel Items''', is a monadic primitive function which returns a matrix formed by applying Ravel to each major cell of the giv...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Table (), or Ravel Items, is a monadic primitive function which returns a matrix formed by applying Ravel to each major cell of the given array. Table shares its glyph with the dyadic function Catenate First.

Examples

For arrays of rank 1 or higher, the result is identical to applying Ravel to major cells. In languages where Rank operator is available, Table is equivalent to ,⍤¯1.

      {⍵(⍴⍵)}⍪5⍴⎕A
┌─┬───┐
│A│5 1│
│B│   │
│C│   │
│D│   │
│E│   │
└─┴───┘
      {⍵(⍴⍵)}⍪3 4⍴⎕A
┌────┬───┐
│ABCD│3 4│
│EFGH│   │
│IJKL│   │
└────┴───┘
      {⍵(⍴⍵)}⍪2 3 4⍴⎕A
┌────────────┬────┐
│ABCDEFGHIJKL│2 12│
│MNOPQRSTUVWX│    │
└────────────┴────┘

A scalar argument is converted to a 1-by-1 matrix:

      {⍵(⍴⍵)}⍪123
┌───┬───┐
│123│1 1│
└───┴───┘

Properties

Table preserves the array's Tally (the number of major cells).

External links

Lessons

Documentation


APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)
Quad names Index originComparison toleranceMigration levelAtomic vector