Skip to content

Main content

List Zip Shortest Tail Loss Tool

Calculate list zip shortest tail loss from explicit caller-supplied inputs.

Loading tool…

Description

Use the shortest as outputLength and subtract it from each source length for discarded.

Zipping lists can stop at the shortest input or extend to the longest with fill values. Those policies trade discarded tails against missing-position padding.

Use the shortest as outputLength and subtract it from each source length for discarded.

When to use this tool

Use List Zip Shortest Tail Loss when you need to compare zip output lengths and per-list losses or fills.

How to use the tool and how it works

  1. Enter lengths. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read outputLength, discarded. Use the output convention below.

Require a nonempty list of nonnegative integer lengths. Use the shortest as outputLength and subtract it from each source length for discarded.1

Input fieldMeaning and unitsAccepted input
lengthsLengthsRequired. Array of safe integer; maximum items 256.
Output fieldInterpretationReturned shape
outputLengthOutput LengthRequired. Safe integer.
discardedDiscardedRequired. Array of safe integer; maximum items 256.
json
{
  "input": {
    "lengths": [
      3,
      5,
      4
    ]
  },
  "output": {
    "outputLength": 3,
    "discarded": [
      0,
      2,
      1
    ]
  }
}

Limitations and assumptions

  • This predicts truncation counts without reading or zipping actual lists.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Choose a missing-value and alignment policy before actually combining records from unequal lists.

References

  1. Calculation and input contract: list/list-zip-shortest-tail-loss — tool.io

Similar or alternative tools