Re: Substitution in BinLists
- To: mathgroup at smc.vnet.net
 - Subject: [mg41452] Re: [mg41435] Substitution in BinLists
 - From: Tomas Garza <tgarza01 at prodigy.net.mx>
 - Date: Tue, 20 May 2003 03:28:33 -0400 (EDT)
 - References: <200305190914.FAA20211@smc.vnet.net>
 - Sender: owner-wri-mathgroup at wolfram.com
 
Try this:
In[1]:=
a = {1, 2, 3, 4, 10}; 
Flatten[BinLists[a, {0, 10, 1}] /. {} -> 0]
Out[1]=
{1, 2, 3, 4, 0, 0, 0, 0, 0, 10}
Tomas Garza
Mexico City
Original Message ----- 
From: "Mark E. Berres" <markb at ravel.zoology.wisc.edu>
To: mathgroup at smc.vnet.net
Subject: [mg41452] [mg41435] Substitution in BinLists
> Hi,
> I'm trying to substitute a zero (0) for bins that are empty when using
> BinLists:
> 
> In[192]:= <<Statistics`DataManipulation`
> In[193]:= a={1,2,3,4,10};
> In[194]:= BinLists[a,{0,10,1}]
> 
> Out[194]:= {{1},{2},{3},{4},{},{},{},{},{},{10}}
> 
> What I would like output is {1,2,3,4,0,0,0,0,0,10}.
> Flatten nearly gets me there but omits the empty bins {}: {1,2,3,4,10}.
> 
> Thanks
> -Mark
> 
> 
> 
> 
- References:
- Substitution in BinLists
- From: "Mark E. Berres" <markb@ravel.zoology.wisc.edu>
 
 
 - Substitution in BinLists