MathGroup Archive 2006

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

Search the Archive

Re: Using implicit information about row indices


In[1]:= L = {{{1, a}, {2, b}},
             {{1, c}, {2, d}, {3, e}, {4, f}},
             {{2, g}, {3, h}, {4, i}},
             {{3, k}, {4, l}, {5,m}},
             {{4, n}, {5, p}}};

In[2]:= Normal[SparseArray[ Rule @@@ #, {Length@L}]& /@ L]
Out[2]= {{a,b,0,0,0},
         {c,d,e,f,0},
         {0,g,h,i,0},
         {0,0,k,l,m},
         {0,0,0,n,p}}


  • Prev by Date: Re: Using implicit information about row indices
  • Next by Date: Re: need to make a special function
  • Previous by thread: Re: Using implicit information about row indices
  • Next by thread: Re: Using implicit information about row indices