6
$\begingroup$

If memory and speed are not concerns, is there a reason to use QuantityArray instead of an array of quantities?

$\endgroup$
2
  • 1
    $\begingroup$ @DanielHuber, it is possible to have something like QuantityArray[RandomInteger[10, {1000, 2}], {"Meters", "Seconds"}], where units are different at the deepest level. This actually works for the n deepest levels. The simplest case is indeed when n = 0, with all entries having the same unit. $\endgroup$ Commented Feb 18, 2024 at 19:45
  • $\begingroup$ @jose You are right, I was mistaken. Thanks for the hint. I deleted my note. $\endgroup$ Commented Feb 18, 2024 at 19:50

1 Answer 1

5
$\begingroup$

I think speed and memory are the primary reasons for using a QuantityArray.

Another benefit is the formatting, a summary box is a more compact visual representation. At a glance you can see the dimensions of the array, the units, and with one click you can see the min and max values.

$\endgroup$
2
  • 2
    $\begingroup$ The compact summary box is indeed quite useful. Clicking the Plus sign gives you bounds information, for example. $\endgroup$ Commented Feb 18, 2024 at 19:48
  • $\begingroup$ Thanks Jose - I updated the response. $\endgroup$ Commented Feb 19, 2024 at 16:33

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.