Functions

histogram Namespace Reference

Functions

def histogram
 Computes the frequency of raw data in order to generate an histogram.

Function Documentation

def histogram::histogram (   binSize,
  inputfile,
  outputfile 
)

Computes the frequency of raw data in order to generate an histogram.

Parameters:
binSizeThe size of the bins in the histogram
inputFileThe name of the file where the raw data can be found. The file should contain only numbers.
outputFileThe name of the output files when the bin frequencies are reported. The file contains a sequence of pairs of values

\[ (x_i,n_i) \]

such that $n_i$ is the number of values $x$ such that

\[ x_i \leq x < x_{i+1} \]

Returns:
The dictionary containing the same information as in the output file.

Example of an input file:

1
2
2.1
3
3.1
3.4
4
4.3
4.5
4.2

Corresponding output file:

1.0 1
2.0 1
2.1 1
3.0 1
3.1 1
3.4 1
4.0 1
4.2 2
4.5 1
 All Classes Namespaces Files Functions Variables