pydit.statistics.benford.benford_mad

pydit.statistics.benford.benford_mad(obj, column_name='', first_n_digits=1)[source]

Returns the Mean Absolute Deviation (MAD) of the Benford’s Law frequencies.

Parameters:
  • obj (DataFrame or Series or list) – The data to be analyzed.

  • column_name (str, optional, default: "") – The column name to be analyzed. Not needed for series or lists

  • first_n_digits (int, optional, default: 1) – The number of first digits to be considered.

Returns:

The Mean Absolute Deviation (MAD) of the Benford’s Law frequencies. The result is a percentage of the expected frequency.

Return type:

float