File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2020import pandas as pd
2121from beartype import beartype
2222from beartype import typing
23+ from copy import copy
2324
2425
2526@beartype ()
@@ -192,15 +193,15 @@ def get_transformation(
192193
193194@beartype ()
194195def apply_transformation (
195- data_anon : pd .DataFrame ,
196+ data : pd .DataFrame ,
196197 quasi_ident : typing .Union [typing .List , np .ndarray ],
197198 hierarchies : dict ,
198199 transformation : list ,
199200) -> pd .DataFrame :
200201 """Apply a given transformation to the data.
201202
202- :param data_anon : data under study.
203- :type data_anon : pandas dataframe
203+ :param data : data under study.
204+ :type data : pandas dataframe
204205
205206 :param quasi_ident: list with the name of the columns of the dataframe
206207 that are quasi-identifiers.
@@ -216,6 +217,7 @@ def apply_transformation(
216217 :return: dataset generalized with the transformation given
217218 :rtype: pandas dataframe
218219 """
220+ data_anon = copy (data )
219221 actual_transform = check_gen_level (data_anon , quasi_ident , hierarchies )
220222 for i , qi in enumerate (quasi_ident ):
221223 hierarchy_qi = hierarchies [qi ]
You can’t perform that action at this time.
0 commit comments