Skip to main content
Commonmark migration
Source Link

So you would like Dimensions which only respects List head? Good question. -- Kuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

 
Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}

So you would like Dimensions which only respects List head? Good question. -- Kuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

 
Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}

So you would like Dimensions which only respects List head? Good question. -- Kuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}
added 110 characters in body
Source Link

So you would like DimensionsDimensions which only respects List head? Good question. -- KubaKuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}

So you would like Dimensions which only respects List head? Good question. -- Kuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}

So you would like Dimensions which only respects List head? Good question. -- Kuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}
Source Link
LLlAMnYP
  • 11.5k
  • 27
  • 66

So you would like Dimensions which only respects List head? Good question. -- Kuba

From the documentation:

The "array" is considered full only when it has the same head as at the top:

Dimensions[f[g[x, y], g[a, b], g[s, t]]]
{3}

So I believe, this could be achieved like so:

listDimensions[arg_] := Rest@Dimensions[{arg}]
listDimensions[a.b]
listDimensions[aa.bb]
{}
{}