Re: Substitution in BinLists
- To: mathgroup at smc.vnet.net
- Subject: [mg41441] Re: [mg41435] Substitution in BinLists
- From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
- Date: Tue, 20 May 2003 03:23:05 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Flatten[BinLists[a,{0,10,1}]/.{}->0]
Bobby
-----Original Message-----
From: Mark E. Berres <markb at ravel.zoology.wisc.edu>
To: mathgroup at smc.vnet.net
Subject: [mg41441] [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