-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path_stats_notebook.py
More file actions
78 lines (61 loc) · 1.47 KB
/
_stats_notebook.py
File metadata and controls
78 lines (61 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# FRONTMATTER_BLOCK
# # TITLE
#
# CUSTOM_NOTE
# + [markdown] tags=["tutorial"]
# Jump ahead:
# - [Analysis](#Analysis)
# - [Results](#Results)
#
# ## Prerequisites
#
# First install and import the required dependencies:
# WINDOWS_COMMENT_BLOCK
# -
# + tags=["tutorial"]
# %pip install DEPENDENCIES
# -
# + tags=["tutorial"]
IMPORTS_BLOCK
# -
# + [markdown] tags=["tutorial"]
# Then define some utility functions to handle dataframes and plot results:
# -
# + tags=["tutorial"]
UTILS_BLOCK
# -
# + [markdown] tags=["tutorial"]
# ## Analysis
#
# Based on the input you provided, for each column we'll create a Polars expression
# that describes how we want to summarize that column.
# -
COLUMNS_BLOCK
# + [markdown] tags=["tutorial"]
# ### Context
#
# Next, we'll define our Context. This is where we set the privacy budget,
# and set the weight for each query under that overall budget.
# -
# + tags=["tutorial"]
STATS_CONTEXT_BLOCK
# -
# + [markdown] tags=["tutorial"]
# CSV_COMMENT_BLOCK
# -
# ## Results
# + [markdown] tags=["tutorial"]
# Finally, we run the queries and plot the results.
# -
STATS_QUERIES_BLOCK
# + [markdown] tags=["tutorial"]
# If we try to run more queries at this point, it will error. Once the privacy budget
# is consumed, the library prevents you from running any more queries.
# -
# + [markdown] tags=["postprocessing"]
# ## Postprocessing
# This code produces the other files that are part of the package.
# -
# + tags=["postprocessing"]
STATS_REPORTS_BLOCK
# -