I am trying to make a histogram or bar chart for multiple large data sets, with 52 bins where I need to do the following operations:
A) Tally the counts per bin (which I have done reasonably easily using Flatten and Tally, shown below)
B) And the more difficult problem as follows: Say I have a table such as
{{{{{1, 2, 3, 46, 47, 48, 49, 50, 51, 52}, 5.}}, {{{1, 12, 23, 46, 47}, 1.}}, {{{5, 6, 7, 8},
20.}}, {{{5, 6, 7, 8, 15, 16, 17}, 34.}}}}
where the first item in each group (1-52) represent the bins and the second item (5 in the first example) represents the value I want to plot.
Taking the first group as an example, I want to insert the number "5" into bins 1,2,3,46,47,48,49,50,51 and 52. As I iterate through my lists I want to keep filling the bins, so the second group has a "1" in bins 1,12,23,46, and 47, so I would want "6" in the bins that overlap. On and on and on through a decent chunk of data.
I've tried many different attempts at a solution using Thread, Collect, Gather, etc. I've tried making more tables or re-indexing, but I'm not closer to a solution than I was when I started. Thanks in advance!