Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2014

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List vs. array in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132576] Re: List vs. array in Mathematica
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 13 Apr 2014 05:27:17 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20140412091439.6C8C069D4@smc.vnet.net>

The function Array does _not_ necessarily a list of uniform depth. For example:

        f[n_] := Nest[List, x, n]
        Array[f, 5]
    (* {{x}, {{x}}, {{{x}}}, {{{{x}}}}, {{{{{x}}}}}} *)

However, the function ArrayQ does not return True for a "ragged" array but only she "all parts at a particular level must be lists of the same length.



On Apr 12, 2014, at 5:14 AM, andymhancock at gmail.com wrote:

> In mathematica, is an array simply a list of uniform depth?  Both terms are used in the documentation, but I haven't run across an explicit explanation of why two terms are needed for the same construct. So I'm wondering if their relationship is.
>

Murray Eisenberg                                murray at math.umass.edu
Mathematics & Statistics Dept.      
Lederle Graduate Research Tower      phone 240 246-7240 (H)
University of Massachusetts               
710 North Pleasant Street                
Amherst, MA 01003-9305









  • Prev by Date: Re: List vs. array in Mathematica
  • Next by Date: Redudant code for style purposes?
  • Previous by thread: List vs. array in Mathematica
  • Next by thread: Re: List vs. array in Mathematica