gives lists of the elements xi whose values lie in successive integer bins.


gives lists of the elements xi whose values lie in successive bins of width dx.


gives lists of the xi that lie in successive bins of width dx from xmin to xmax.


gives lists of the xi that lie in the intervals [b1,b2), [b2,b3), .


gives an array of lists where the first index corresponds to x bins, the second to y, and so on.


  • BinLists drops elements whose values do not correspond to real numbers.
  • Within each bin, elements appear in the same order as in the original data.
  • BinLists[data,dx] takes the bin boundaries to be integer multiples of dx, with the first bin starting at Ceiling[Min[data]-dx,dx] and the last bin ending at Floor[Max[data]+dx,dx].
  • BinLists[data] is equivalent to BinLists[data,1].
  • BinLists[data,{xmin,xmax}] is equivalent to BinLists[data,{xmin,xmax,1}].
  • In BinLists[data,{xmin,xmax,dx}], elements are placed in bin i when their values satisfy .
  • In the form BinLists[data,{{b1,b2,}}], the bi at each end can be -Infinity and +Infinity.
  • If the bi do not form an increasing sequence, they are automatically sorted by BinLists.
  • In BinLists[data,{{b1,b2,}}], elements are put in bin i when their values satisfy .
  • If data consists of length-n sublists, then n bin specifications must be given, and BinLists[data,] yields an array of lists of depth n.
  • BinLists works with SparseArray objects.


open allclose all

Basic Examples  (3)

Make lists of elements in bins of width 1 from 0 to 10:

List elements in a sequence of ranges:

List elements in bins of a specified width:

Scope  (7)

List squares mod 3 and 5 in two-dimensional unit bins:

List random pairs in bins of width 0.25 in both dimensions:

List multidimensional data in ranges:

Bin data in any dimension:

Bin data, ignoring values that are not real:

Bin data of any precision:

Bin data from a time series:

The time stamps are ignored:

Applications  (1)

Visualize two-dimensional data in bins:

Properties & Relations  (1)

The length of BinLists is equivalent to the results from BinCounts:

Possible Issues  (1)

Binning intervals are closed on the left:

Introduced in 2007