Secure Data Disclosure: Client side
-This notebook showcases how researcher could use the Secure Data Disclosure system. It explains the different functionnalities provided by the dpserial client library to interact with the secure server.
+Lomas Client Side: Using Smartnoise-SQL
+This notebook showcases how researcher could use lomas platform with Smartnoise-SQL. It explains the different functionnalities provided by the lomas-client
client library to interact with lomas server.
The secure data are never visible by researchers. They can only access to differentially private responses via queries to the server.
Each user has access to one or multiple projects and for each dataset has a limited budget \(\epsilon\), \(\delta\).
-🐧🐧🐧 In this notebook the researcher is a penguin researcher named Dr. Antarctica. She aims to do a grounbdbreaking research on various penguins dimensions.
-Therefore, the powerful queen Icerbegina 👑 had the data collected. But in order to get the penguins to agree to participate she promised them that no one would be able to look at the data and that no one would be able to guess the bill width of any specific penguin (which is very sensitive information) from the data. Nobody! Not even the researchers. The queen hence stored the data on the Secure Data Disclosure Server and only gave a small budget to Dr. Antarctica.
-This is not a problem for Dr. Antarctica as she does not need to see the data to make statistics thanks to the Secure Data Disclosure Client library ofs_dpserial. 🐧🐧🐧
+In this notebook the researcher is a penguin researcher named Dr. Antarctica. She aims to do a grounbdbreaking research on various penguins data.
Step 1: Install the library
-To interact with the secure server on which the data is stored, Dr.Antartica first needs to install the library fso_dpserial
on her local developping environment.
To interact with the secure server on which the data is stored, Dr.Antartica first needs to install the library lomas-client
on her local developping environment.
It can be installed via the pip command:
[1]:
# !pip install lomas_client
+
Or using a local version of the client
+[2]:
+
import sys
import os
sys.path.append(os.path.abspath(os.path.join('..')))
-# !pip install lomas_client
[2]:
+[3]:
from lomas_client.client import Client
@@ -164,9 +173,9 @@ Step 1: Install the library
Once the library is installed, a Client object must be created. It is responsible for sending sending requests to the server and processing responses in the local environment. It enables a seamless interaction with the server.
To create the client, Dr. Antartica needs to give it a few parameters: - a url: the root application endpoint to the remote secure server. - user_name: her name as registered in the database (Dr. Alice Antartica) - dataset_name: the name of the dataset that she wants to query (PENGUIN)
-She will only be able to query on the real dataset if the queen Icergina has previously made her an account in the database, given her access to the PENGUIN dataset and has given her some epsilon and delta credit. (As is done in the Secure Data Disclosure Notebook: Server side).
+She will only be able to query on the real dataset if the administrator has previously made her an account in the database, given her access to the PENGUIN dataset and has given her some \(\epsilon\), \(\delta\) privacy loss budget.
-[3]:
+[4]:
APP_URL = "http://lomas_server"
@@ -176,16 +185,12 @@ Step 2: Initialise the clientfso_dpserial.
+And that’s it for the preparation. She is now ready to use the various functionnalities offered by lomas-client
.
-
-Step 3: Understand the functionnalities of the library
-
-Getting dataset metadata
-Dr. Antartica has never seen the data and as a first step to understand what is available to her, she would like to check the metadata of the dataset. Therefore, she just needs to call the get_dataset_metadata()
function of the client. As this is public information, this does not cost any budget.
-This function returns metadata information in the same format as SmartnoiseSQL dictionary format, where among other, there is information about all the available columns, their type, bound values (see Smartnoise page for more details).
+
+Step 3: Getting dataset metadata
-[4]:
+[5]:
metadata = client.get_dataset_metadata()
@@ -194,7 +199,7 @@ Getting dataset metadata
-[4]:
+[5]:
@@ -218,472 +223,379 @@ Getting dataset metadatamax_ids: 1 that each penguin can only be once in the dataset and on the field row_privacy: True
that each row represents a single penguin.
-
-
-Get a dummy dataset
-Now, that she has seen and understood the metadata, she wants to get an even better understanding of the dataset (but is still not able to see it). A solution to have an idea of what the dataset looks like it to create a dummy dataset.
-Based on the public metadata of the dataset, a random dataframe can be created created. By default, there will be 100 rows and the seed is set to 42 to ensure reproducibility, but these 2 variables can be changed to obtain different dummy datasets. Getting a dummy dataset does not affect the budget as there is no differential privacy here, it is not a synthetic dataset and all that could be learn here is already present in the public metadata.
-Dr. Antartica first create a dummy dataset with the default options.
-[5]:
+[6]:
-df_dummy = client.get_dummy_dataset()
-print(df_dummy.shape)
-df_dummy.head()
+nb_penguin = metadata['rows']
+print(f"Number of penguins: {nb_penguin}.")
-
+
-(100, 7)
+Number of penguins: 344.
+
+[7]:
+
+
+columns = metadata["columns"].keys()
+columns
+
+
+
-[5]:
+[7]:
-
-
-
-
-
-
-
- species
- island
- bill_length_mm
- bill_depth_mm
- flipper_length_mm
- body_mass_g
- sex
-
-
-
-
- 0
- Chinstrap
- Torgersen
- 43.108904
- 13.314292
- 214.203165
- 2258.408606
- FEMALE
-
-
- 1
- Adelie
- Dream
- 63.275001
- 19.364104
- 158.413996
- 4656.773158
- FEMALE
-
-
- 2
- Adelie
- Dream
- 55.619788
- 16.143560
- 166.162871
- 4703.175608
- FEMALE
-
-
- 3
- Adelie
- Biscoe
- 50.953047
- 18.085707
- 239.855419
- 5187.149507
- MALE
-
-
- 4
- Gentoo
- Torgersen
- 35.460652
- 22.075665
- 210.642906
- 5630.456669
- MALE
-
-
-
-
+
+
+dict_keys(['species', 'island', 'bill_length_mm', 'bill_depth_mm', 'flipper_length_mm', 'body_mass_g', 'sex'])
+
-However, she would prefer to have a dataset with 200 rows and chooses a seed of 0, hence:
+
+
+Step 4: Average bill length with Smartnoise-SQL
+
+Query dummy dataset
+Now that she has an idea of what the data looks like, she wants to start querying the real dataset to for her research. However, before this, other tools are at her disposal to reduce potential error risks and avoid spending budget on irrelevant queries. Of course, this does not have any impact on the budget.
+It is possible to specify the flag dummy=True
in the various queries to perform the query on the dummy dataset instead of the real dataset and ensure that the queries are doing what is expected of them.
-[6]:
+[8]:
-NB_ROWS = 200
-SEED = 0
+# Average bill length in mm
+QUERY = "SELECT AVG(bill_length_mm) AS avg_bill_length_mm FROM df"
-
-[7]:
+
+[9]:
-df_dummy = client.get_dummy_dataset(nb_rows = NB_ROWS, seed = SEED)
-print(df_dummy.shape)
-df_dummy.head()
+EPSILON = 0.5
+DELTA = 1e-5
-
-
-
-
-
-(200, 7)
-
+
+[10]:
+
-
-[7]:
+# On the remote server dummy dataframe
+dummy_res = client.smartnoise_sql_query(
+ query = QUERY,
+ epsilon = EPSILON,
+ delta = DELTA,
+ dummy = True,
+)
-
-
-
-
-
-
-
- species
- island
- bill_length_mm
- bill_depth_mm
- flipper_length_mm
- body_mass_g
- sex
-
-
-
-
- 0
- Gentoo
- Biscoe
- 49.208473
- 16.117959
- 190.125950
- 2873.291927
- FEMALE
-
-
- 1
- Gentoo
- Torgersen
- 55.031628
- 19.963435
- 242.929142
- 3639.940005
- FEMALE
-
-
- 2
- Chinstrap
- Torgersen
- 51.096718
- 16.777518
- 159.961493
- 5401.743330
- MALE
-
-
- 3
- Adelie
- Biscoe
- 49.070911
- 14.796037
- 244.530153
- 2316.038092
- MALE
-
-
- 4
- Chinstrap
- Biscoe
- 44.827918
- 13.246787
- 236.948853
- 5036.246870
- FEMALE
-
-
-
-
-
-
-Query dummy dataset
-Now that she has an idea of what the data looks like, she wants to start querying the real dataset to for her research. However, before this other tools are at her disposal to reduce potential error risks and avoid spending budget on irrelevant queries. Of course, this does not have any impact on the budget.
-It is possible to specify the flag dummy=True
in the various queries to perform the query on the dummy dataset instead of the real dataset and ensure that the queries are doing what is expected of them.
-Therefore Dr. Antartica computes the results that she gets on the dummy dataframe that she created locally and on the same dummy dataframe in the server via a query and compare them to ensure that the query is well defined and works within the server.
-She tests with an example on the average bill length on the dataframe.
-[8]:
+[11]:
-# On the local dummy dataframe
-result_local_dummy = round(df_dummy['bill_length_mm'].mean(), 5)
-result_local_dummy
+avg_bl_dummy = np.round(dummy_res['query_response']["avg_bill_length_mm"][0], 2)
+f"Average bill length on dummy: {avg_bl_dummy}mm."
-[8]:
+[11]:
-47.51532
+'Average bill length on dummy: 46.68mm.'
-As the query on the server goes through the same workflow for dummies and real data, she still has to set values for theoratical budget to spend on the dummy query. Of course, this theoretical budget will NOT affect her real budget as this is on dummy data.
-It is recommended to use very high values on the budget parameters here to have little noise and small difference between the exact local result and the ‘little noisy’ server result.
-Also, make sure to use the same values of number of rows and seed to have the same dummy datasets.
+
+
+Estimate cost of a query
+Dr. Antartica checks the budget that computing the average bill length will really cost her if she asks the query with an epsilon
and a delta
.
-[9]:
+[12]:
-# Average bill length in mm
-QUERY = "SELECT AVG(bill_length_mm) AS avg_bill_length_mm FROM df"
+cost = client.estimate_smartnoise_sql_cost(
+ query = QUERY,
+ epsilon = EPSILON,
+ delta = DELTA,
+)
-[10]:
+[13]:
-# On the remote server dummy dataframe
-res = client.smartnoise_sql_query(
- query = QUERY,
- epsilon = 100.0, # make sure to select high values of epsilon and delta to have small differences
- delta = 2.0, # make sure to select high values of epsilon and delta to have small differences
- dummy = True,
- nb_rows = NB_ROWS,
- seed = SEED
-)
-res_server_dummy = res['query_response']["avg_bill_length_mm"][0]
-res_server_dummy
+f'This query would actually cost her {cost["epsilon_cost"]} epsilon and {cost["delta_cost"]} delta.'
-[10]:
+[13]:
-47.51229381350249
+'This query would actually cost her 1.0 epsilon and 5.000000000032756e-06 delta.'
-She then checks that the responses on the dummy locally and the dummy on the server are close enough (difference would be only due to small noise addition).
+This is actually twice as much as what she initially put in. In the background, Smartnoise-SQL decomposes the DP query in multiple other queries and the budget given as input is spent on each of these sub-queries. Here for the average, we need a sum divided by a count, hence EPSILON
is spent once for the sum and then once more for the count. (see NOTE below for tips and explanation).
+
+
+Overide DP mechanism
+She wants to use another DP-mechanism for this query. She can change it via the mechanism
argument. See Smartnoise-SQL documentation here for overriding mechanisms.
-[11]:
+[14]:
-np.testing.assert_almost_equal(
- result_local_dummy,
- res_server_dummy,
- decimal=2,
- err_msg="Responses are different, either try with a bigger budget or query is not doing what is intended."
+# On the remote server dummy dataframe
+dummy_res = client.smartnoise_sql_query(
+ query = QUERY,
+ epsilon = EPSILON,
+ delta = DELTA,
+ mechanisms = {"count": "gaussian", "sum_float": "laplace"},
+ dummy = True,
)
-As you can see res_local and res_server are close. We can accept that the small difference is due to the small noise added due to the large values of \(\epsilon\) and \(\delta\).
-
-
-Get current budget
-It is the first time that Dr. Antartica connects to the server and she wants to know how much buget the queen assigned her. Therefore, she calls the fonction get_initial_budget
.
-[12]:
+[15]:
-client.get_initial_budget()
+avg_bl_dummy = np.round(dummy_res['query_response']["avg_bill_length_mm"][0], 2)
+f"Average bill length on dummy: {avg_bl_dummy}mm."
-[12]:
+[15]:
-{'initial_epsilon': 10.0, 'initial_delta': 0.005}
+'Average bill length on dummy: 50.83mm.'
-She sees that she has 10.0 epsilon and 0.0004 epsilon at her disposal.
-Then she checks her total spent budget get_total_spent_budget
. As she only did queries on metadata on dummy dataframes, this should still be 0.
-[13]:
+[16]:
-client.get_total_spent_budget()
+cost = client.estimate_smartnoise_sql_cost(
+ query = QUERY,
+ epsilon = EPSILON,
+ delta = DELTA,
+ mechanisms = {"count": "gaussian", "sum_float": "laplace"}
+)
+cost
-[13]:
+[16]:
-{'total_spent_epsilon': 2.714285714286655, 'total_spent_delta': 0.0}
+{'epsilon_cost': 1.0, 'delta_cost': 1.4999949999983109e-05}
-It will also be useful to know what the remaining budget is. Therefore, she calls the function get_remaining_budget
. It just substarcts the total spent budget from the initial budget.
+
+
+Query real dataset
+Dr. Antartica is ready to query the real dataset and get a differentially private response for the average bill length. The dummy
flag is False by default, so setting it is optional. She uses the values of epsilon
and delta
that she selected just before.
+Careful: This command DOES spend the budget of the user and the remaining budget is updated for every query.
+
+[17]:
+
+
+avg_bill_length_response = client.smartnoise_sql_query(
+ query = QUERY,
+ epsilon = EPSILON,
+ delta = DELTA,
+ mechanisms = {"count": "gaussian", "sum_float": "laplace"},
+ dummy = False
+)
+
+
+
-[14]:
+[18]:
-client.get_remaining_budget()
+avg_bill_length = avg_bill_length_response['query_response']['avg_bill_length_mm'].iloc[0]
+print(f"Average bill length on private data: {np.round(avg_bill_length, 2)}mm.")
-[14]:
-
+
-{'remaining_epsilon': 7.285714285713345, 'remaining_delta': 0.005}
+Average bill length on private data: 45.19mm.
-As expected, for now the remaining budget is equal to the inital budget.
+After each query on the real dataset, the budget informations are also returned to the researcher. It is possible possible to check the remaining budget again afterwards:
-
-Estimate cost of a query
-Another safeguard is the functionnality to estimate the cost of a query. As in OpenDP and SmartnoiseSQL, the budget that will by used by a query might be slightly different than what is asked by the user. The estimate cost
function returns the estimated real cost of any query.
-Again, of course, this will not impact the user’s budget.
-Dr. Antartica checks the budget that computing the average bill length will really cost her if she asks the query with an epsilon
and a delta
.
+
+Postprocess
+It is also possible to use the ‘postprocess’ argument from Smartnoise-SQL see its documentation here by specifying it in the query.
-[15]:
+[19]:
-client.estimate_smartnoise_sql_cost(
+dummy_res = client.smartnoise_sql_query(
query = QUERY,
- epsilon = 1.0,
- delta = 1e-4
+ epsilon = EPSILON,
+ delta = DELTA,
+ postprocess = True,
+ dummy = True,
)
+dummy_res
-[15]:
+[19]:
-{'epsilon_cost': 2.0, 'delta_cost': 4.999999999999449e-05}
+{'query_response': avg_bill_length_mm
+ 0 46.850983}
-So this query would actually cost her 3.0 epsilon and a little 1.499e-4 delta. As she does not want to spend to much budget here she tries other values of budget.
-[16]:
+[20]:
-client.estimate_smartnoise_sql_cost(
+dummy_res = client.smartnoise_sql_query(
query = QUERY,
- epsilon = 0.2,
- delta = 1e-5
+ epsilon = EPSILON,
+ delta = DELTA,
+ postprocess = False,
+ dummy = True,
)
+dummy_res
-[16]:
+[20]:
-{'epsilon_cost': 0.4, 'delta_cost': 5.000000000032756e-06}
+{'query_response': res_0 res_1
+ 0 4659.909203 96.041455}
-This query would actually cost her 0.6 epsilon and a similar delta. She decides that it is good enough.
+
+
+
+Step 4: Penguin statistics
+
+Confidence intervals for flipper length over the whole population
+She is first interested to have a better idea of the distribution of bill length of all species. She already has the number of penguins (=number of rows as max_ids=1
) from the metadata and the average bill length from step 3, so she just needs to compute the standard deviation. As it is just an exploration step, she uses very little budget values.
-[17]:
+[21]:
+
+
+QUERY = "SELECT STD(bill_length_mm) AS std_bill_length_mm FROM df"
+
+
+
+She again first verifies that her query works on the dummy dataset:
+
+[22]:
+
+
+dummy_res = client.smartnoise_sql_query(
+ query = QUERY,
+ epsilon = 0.5,
+ delta = 1e-5,
+ dummy = True
+)
+
+
+
+
+[23]:
+
+
+dummy_std = np.round(dummy_res['query_response']['std_bill_length_mm'].iloc[0], 2)
+f"The dummy standard variation is {dummy_std}."
+
+
+
+
+[23]:
+
+
+
+
+'The dummy standard variation is 16.64.'
+
+
+The syntax of the query works, now she checks the budget:
+
+[24]:
-EPSILON = 0.2
-DELTA = 1e-5
+cost = client.estimate_smartnoise_sql_cost(
+ query = QUERY,
+ epsilon = 0.5,
+ delta = 1e-5
+)
-
-
-Query real dataset
-Now that all the safeguard functions were tested, Dr. Antartica is ready to query on the real dataset and get a differentially private response of the average bill length. By default, the flag dummy
is False so setting it is optional. She uses the values of epsilon
and delta
that she selected just before.
-Careful: This command DOES spend the budget of the user and the remaining budget is updated for every query.
-[18]:
+[25]:
-client.get_remaining_budget()
+f'This query would actually cost her {cost["epsilon_cost"]} epsilon and {cost["delta_cost"]} delta.'
-[18]:
+[25]:
-{'remaining_epsilon': 7.285714285713345, 'remaining_delta': 0.005}
+'This query would actually cost her 1.5 epsilon and 5.000000000032756e-06 delta.'
+This time it is three times the budget because the standard deviation needs the average, then a difference and a count again.
-[19]:
+[26]:
-avg_bill_length_response = client.smartnoise_sql_query(
+response = client.smartnoise_sql_query(
query = QUERY,
- epsilon = EPSILON,
- delta = DELTA,
- dummy = False
+ epsilon = 0.5,
+ delta = 1e-5
)
-[20]:
+[27]:
-avg_bill_length = avg_bill_length_response['query_response']['avg_bill_length_mm'].iloc[0]
-print(f"Average bill length: {np.round(avg_bill_length, 2)}mm.")
+std_bill_length = response['query_response']['std_bill_length_mm'].iloc[0]
+print(f"Standard deviation of bill length: {np.round(std_bill_length, 2)}.")
@@ -692,267 +604,225 @@ Query real dataset
-Average bill length: 44.18mm.
+Standard deviation of bill length: 8.83.
-After each query on the real dataset, the budget informations are also returned to the researcher. It is possible possible to check the remaining budget again afterwards:
+She can now do all the postprocessing that she wants with the returned data without increasing the privacy risk.
-[21]:
+[28]:
-client.get_remaining_budget()
+# Get standard error
+standard_error = std_bill_length/np.sqrt(nb_penguin)
+print(f"Standard error of bill length: {np.round(standard_error, 2)}.")
-[21]:
-
+
-{'remaining_epsilon': 6.885714285713345,
- 'remaining_delta': 0.004994999999999967}
+Standard error of bill length: 0.48.
-As can be seen in get_total_spent_budget()
, it is the budget estimated with estimate_cost()
that was spent.
-[22]:
+[29]:
-client.get_total_spent_budget()
+ # Compute the 95% confidence interval
+ZSCORE = 1.96
+lower_bound, upper_bound = avg_bill_length - ZSCORE*standard_error, avg_bill_length + ZSCORE*standard_error
+print(f"The 95% confidence interval of the bill length of all penguins is [{np.round(lower_bound, 2)}, {np.round(upper_bound, 2)}].")
-[22]:
-
+
-{'total_spent_epsilon': 3.114285714286655,
- 'total_spent_delta': 5.000000000032756e-06}
+The 95% confidence interval of the bill length of all penguins is [44.25, 46.12].
-Dr. Antartica has now a differentially private estimation of the bill length of all birds and is confident to use the library for the rest of her analyses.
-
-Step 4: Penguin statistics
-
-Confidence intervals for flipper length over the whole population
-She is first interested to have a better idea of the distribution of flipper length of all species. She already has the mean from step 3, so she just need to compute the standard deviation and know the number of penguins in the dataset. As it is just an exploration step, she uses very little budget values.
+
+Note on budget with Smartnoise-SQL (Advanced)
+All of these queries will cost the same budget in Smartnoise-SQL. The reason is that the smartnoise-sql translates the input query in sub queries, finds the answer for each sub query for the budget in input and then assembles the results. For the first ‘standard deviation’ query, it requires a count, an average, and only then the computation for the standard deviation. Hence, to save budget it is better to make a general query directly and retrieve all the ‘sub-answers’.
-[23]:
+[30]:
-QUERY = "SELECT COUNT(bill_length_mm) AS nb_penguin, STD(bill_length_mm) AS std_bill_length_mm FROM df"
+epsilon = 1.0
+delta = 1e-5
-She again first verifies that her query works on the dummy dataset:
-[24]:
+[31]:
-dummy_res = client.smartnoise_sql_query(
- query = QUERY,
- epsilon = 100.0,
- delta = 10.0,
- dummy = True
-)
-dummy_res['query_response']
+QUERY = "SELECT STD(bill_length_mm) AS std_bill_length_mm FROM df"
+cost = client.estimate_smartnoise_sql_cost(query = QUERY, epsilon = epsilon, delta = delta)
+cost
-[24]:
+[31]:
-
-
-
-
-
-
-
- nb_penguin
- std_bill_length_mm
-
-
-
-
- 0
- 100
- 10.332225
-
-
-
-
+
+
+{'epsilon_cost': 3.0, 'delta_cost': 5.000000000032756e-06}
+
-The syntax of the query works, now she checks the budget:
-[25]:
+[32]:
-client.estimate_smartnoise_sql_cost(
- query = QUERY,
- epsilon = 0.5,
- delta = 1e-5
-)
+QUERY = "SELECT AVG(bill_length_mm) AS avg_bl, STD(bill_length_mm) as std_bl FROM df"
+cost = client.estimate_smartnoise_sql_cost(query = QUERY, epsilon = epsilon, delta = delta)
+cost
-[25]:
+[32]:
-{'epsilon_cost': 1.5, 'delta_cost': 5.000000000032756e-06}
+{'epsilon_cost': 3.0, 'delta_cost': 5.000000000032756e-06}
-It is a bit too much, she decides to test for less:
-[26]:
+[33]:
-client.estimate_smartnoise_sql_cost(
- query = QUERY,
- epsilon = 0.25,
- delta = 1e-5
-)
+QUERY = "SELECT COUNT(bill_length_mm) AS count_bl, AVG(bill_length_mm) AS avg_bl, STD(bill_length_mm) as std_bl FROM df"
+cost = client.estimate_smartnoise_sql_cost(query = QUERY, epsilon = epsilon, delta = delta)
+cost
-[26]:
+[33]:
-{'epsilon_cost': 0.75, 'delta_cost': 5.000000000032756e-06}
+{'epsilon_cost': 3.0, 'delta_cost': 5.000000000032756e-06}
-That’s fine, she is ready to query:
+A way to know the sub-queries of a query is to use the following Smartnoise-SQL code:
+
+[34]:
+
+
+# Convert metadata to Smartnoise-SQL compliant metadata
+metadata = dict(metadata)
+metadata.update(metadata["columns"])
+del metadata["columns"]
+snsql_metadata = {"": {"": {"df": metadata}}}
+
+
+
+
+[35]:
+
+
+# Write the query to inspect
+QUERY = "SELECT STD(bill_length_mm) as std_bl FROM df"
+#QUERY = "SELECT COUNT(*) as nb_row FROM df"
+
+
+
-[27]:
+[36]:
-response = client.smartnoise_sql_query(query = QUERY, epsilon = 0.25, delta = 1e-5)
-response = response['query_response']
-response
+from snsql.sql.private_rewriter import Rewriter
+rewriter = Rewriter(snsql_metadata)
+rewriter.options.row_privacy = metadata["row_privacy"]
+rewriter.options.max_contrib = metadata["max_ids"]
+dp_query = rewriter.query(QUERY)
+dp_query
-[27]:
+[36]:
-
-
-
-
-
-
-
- nb_penguin
- std_bill_length_mm
-
-
-
-
- 0
- 343
- 13.064982
-
-
-
-
+
+
+<snsql._ast.ast.Query at 0x70772e4e5310>
+
+The original dp query is represented as one query:
-[28]:
+[37]:
-nb_penguin = response['nb_penguin'].iloc[0]
-print(f"Number of penguins: {nb_penguin}.")
-
-std_bill_length = response['std_bill_length_mm'].iloc[0]
-print(f"Standard deviation of bill length: {np.round(std_bill_length, 2)}.")
+