Additionally these might work. Suppose you have data:
dataorig = RandomInteger[{-10, 10}, 1000];
You can then generate a list of values vs repetitions like so:
data = SortBy[Tally[dataorig], First];
Of course, you can always reconstruct something with the same distribution as the original:
datarestore = Flatten[ConstantArray[#[[1]], #[[2]]] & /@ data];
The way described in the first answer is more elegant:
datarestore = Table[#[[1]], {#[[2]]}] & /@ data
Note that you can get a histogram directly from the data by using a BarChart:
BarChart[data[[All, 2]], ChartLabels -> data[[All, 1]]]
From the restored data it is easy to compute the mean and the standard deviation:
N@Mean[datarestore]
and
N@StandardDeviation[datarestore]
You can also use WeightedData to achieve something that you can easily evaluate:
dataweight=WeightedData @@ Transpose[data]
and then
N@Mean[dataweight]
and
N@StandardDeviation[dataweight]
Interestingly:
N@StandardDeviation[dataweight] == N@StandardDeviation[datarestore]
is False.
Cheers,
Marco