Questions or feedback?

opendp.extras.examples package#

Module contents#

For convenience, all the functions of this module are also available from opendp.prelude. We suggest importing under the conventional name dp:

>>> import opendp.prelude as dp

The methods of this module will then be accessible at dp.examples.

opendp.extras.examples.get_california_pums_path()[source]#

Returns the path to a CSV derived from a PUMS (Public Use Microdata Sample) file from the US Census. A header row is not included. The columns are:

  • age

  • sex

  • educ

  • race

  • income

  • married

Return type:

Path

opendp.extras.examples.get_france_lfs_path()[source]#

Returns the path to a CSV derived from the EU Labor Force Survey. First row contains the column names.

Code developed to work with a public microdata set like this could also be used with the scientific use files, and we believe that differential privacy would be a good tool to ensure that statistics derived from scientific use files could not inadvertantly reveal personal information.

To reduce the download size for the tutorial, we’ve preprocessed the data by selecting a single country (France), dropping unused columns, sampling a subset of the rows, and concatenating the result into a single CSV. The code we’ll present in the tutorials could be run on the original public microdata, or for that matter, the full private scientific use files.

Return type:

Path